Arch Axis tool on a new document

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Arch Axis tool on a new document

Post by bernd »

output if steps are done in FreeCAD GUI by Mous clicking

Code: Select all

Python 2.7.8 (default, Nov 17 2014, 20:37:05) [MSC v.1800 64 bit (AMD64)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> import WebGui
>>> from StartPage import StartPage
>>> WebGui.openBrowserHTML(StartPage.handle(),App.getResourceDir() + 'Mod/Start/StartPage/','Start page')
>>> Gui.activateWorkbench("ArchWorkbench")
>>> App.newDocument("Unbenannt")
>>> App.setActiveDocument("Unbenannt")
>>> App.ActiveDocument=App.getDocument("Unbenannt")
>>> Gui.ActiveDocument=Gui.getDocument("Unbenannt")
>>> import Arch
>>> Arch.makeAxis()
>>> App.activeDocument().recompute()
>>>
Last edited by bernd on Wed Feb 10, 2016 3:39 pm, edited 1 time in total.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Arch Axis tool on a new document

Post by bernd »

bernd wrote:Be sure first change to arch wb and than create the new document !
Have you guys seen this !
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Arch Axis tool on a new document

Post by jmaustpc »

bernd wrote:Be sure first change to arch wb and than create the new document !
Yes, that is what I was doing.

Is there any chance that you guys have "DraftWB" disabled? There is, (or was, I can't see it just now) an option to hide the Draft WB as most of its tools were available in Arch.


Python 2.7.6 (default, Jun 22 2015, 18:01:27)
[GCC 4.8.2] on linux2
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> import WebGui
>>> from StartPage import StartPage
>>> WebGui.openBrowserHTML(StartPage.handle(),'file://' + App.getResourceDir() + 'Mod/Start/StartPage/','Start page')
>>> Gui.activateWorkbench("ArchWorkbench")
>>> App.newDocument("Unnamed")
>>> App.setActiveDocument("Unnamed")
>>> App.ActiveDocument=App.getDocument("Unnamed")
>>> Gui.ActiveDocument=Gui.getDocument("Unnamed")
>>> import Arch
>>> Arch.makeAxis()
>>> Gui.SendMsgToActiveView("ViewFit")
>>>
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Arch Axis tool on a new document

Post by bernd »

Does this help:

- start FreeCAD
- copy the following code

Code: Select all

import Arch
App.newDocument()
Arch.makeAxis()
gives error and axis is grey. There seams somthing with the view provider

Code: Select all

Python 2.7.8 (default, Nov 17 2014, 20:37:05) [MSC v.1800 64 bit (AMD64)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> import WebGui
>>> from StartPage import StartPage
>>> WebGui.openBrowserHTML(StartPage.handle(),App.getResourceDir() + 'Mod/Start/StartPage/','Start page')
>>> import Arch
>>> App.newDocument()
<Document object at 00000000054960E0>
>>> App.setActiveDocument("Unnamed")
>>> App.ActiveDocument=App.getDocument("Unnamed")
>>> Gui.ActiveDocument=Gui.getDocument("Unnamed")
>>> Arch.makeAxis()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Daten\FreeCAD_0.16.6397_x64_dev_bin\Mod\Arch\ArchAxis.py", line 46, in makeAxis
    _ViewProviderAxis(obj.ViewObject)
  File "C:\Daten\FreeCAD_0.16.6397_x64_dev_bin\Mod\Arch\ArchAxis.py", line 141, in __init__
    vobj.Proxy = self
Base.FreeCADError: Unknown C++ exception
>>> 
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Arch Axis tool on a new document

Post by rockn »

Yes I follow exactly your steps.
bernd wrote:
gives error and axis is grey.
Can you provide errors from Report View, please. If there is...
Formations - Assistance - Développement : https://freecad-france.com
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Arch Axis tool on a new document

Post by jmaustpc »

bernd wrote:
bernd wrote:Be sure first change to arch wb and than create the new document !
Have you guys seen this !
yes,

but to be clear, I do not have to "recompute" a simple view zoom fit all shows them for me, and my recompute icon is greyed out.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Arch Axis tool on a new document

Post by jmaustpc »

rockn wrote:Yes I follow exactly your steps.
bernd wrote:
gives error and axis is grey.
Can you provide errors from Report View, please. If there is...
none for me, but since it works for me of course you would expect that. the only message in my report view is of course "Arch workbench activated"
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Arch Axis tool on a new document

Post by bernd »

rockn wrote:@bernd, I still can't reproduce.

No output in Report View ?
sorry rockn I missed the report view ... Ok here we are all informations ...

- startFreeCAD
- open Arch workbench
- create a empty document
- click on Arch axis tool
- click on recompute
- right click view fit

Python Konsole

Code: Select all

Python 2.7.8 (default, Nov 17 2014, 20:37:05) [MSC v.1800 64 bit (AMD64)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> import WebGui
>>> from StartPage import StartPage
>>> WebGui.openBrowserHTML(StartPage.handle(),App.getResourceDir() + 'Mod/Start/StartPage/','Start page')
>>> Gui.activateWorkbench("ArchWorkbench")
>>> App.newDocument("Unbenannt")
>>> App.setActiveDocument("Unbenannt")
>>> App.ActiveDocument=App.getDocument("Unbenannt")
>>> Gui.ActiveDocument=Gui.getDocument("Unbenannt")
>>> import Arch
>>> Arch.makeAxis()
>>> App.activeDocument().recompute()
>>> Gui.SendMsgToActiveView("ViewFit")
>>> 
Report window:

Code: Select all

Arch workbench activated
Running the Python command 'Arch_Axis' failed:
Traceback (most recent call last):
  File "C:\Daten\FreeCAD_0.16.6397_x64_dev_bin\Mod\Arch\ArchAxis.py", line 75, in Activated
    FreeCADGui.doCommand("Arch.makeAxis()")
  File "<string>", line 1, in <module>
  File "C:\Daten\FreeCAD_0.16.6397_x64_dev_bin\Mod\Arch\ArchAxis.py", line 46, in makeAxis
    _ViewProviderAxis(obj.ViewObject)
  File "C:\Daten\FreeCAD_0.16.6397_x64_dev_bin\Mod\Arch\ArchAxis.py", line 141, in __init__
    vobj.Proxy = self

Unknown C++ exception
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6397 (Git)
Build type: Release
Branch: master
Hash: 6763d3a6e48b6f74d48bca593baa8773897c7220
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17


EDIT: or see Post viewtopic.php?f=23&t=14173&p=113740#p113735
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Arch Axis tool on a new document

Post by yorik »

bernd wrote:Report window:

Code: Select all
Arch workbench activated
Running the Python command 'Arch_Axis' failed:
Traceback (most recent call last):
File "C:\Daten\FreeCAD_0.16.6397_x64_dev_bin\Mod\Arch\ArchAxis.py", line 75, in Activated
FreeCADGui.doCommand("Arch.makeAxis()")
File "<string>", line 1, in <module>
File "C:\Daten\FreeCAD_0.16.6397_x64_dev_bin\Mod\Arch\ArchAxis.py", line 46, in makeAxis
_ViewProviderAxis(obj.ViewObject)
File "C:\Daten\FreeCAD_0.16.6397_x64_dev_bin\Mod\Arch\ArchAxis.py", line 141, in __init__
vobj.Proxy = self

Unknown C++ exception
Okay now we are advancing.. The view provider is not created, for some reason. I suspect it might have to do with the default settings. Can you try this code (with a new document open)? It should give more info:

Code: Select all

o = App.ActiveDocument.addObject("App::FeaturePython","test")
import ArchAxis
ArchAxis._Axis(o)
ArchAxis._ViewProviderAxis(o.ViewObject)
o.Distances=[500,500]
o.Angles=[0,0]
App.ActiveDocument.recompute()
Gui.SendMsgToActiveView("ViewFit")
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Arch Axis tool on a new document

Post by bernd »

yorik wrote: Can you try this code (with a new document open)? It should give more info:

Code: Select all

o = App.ActiveDocument.addObject("App::FeaturePython","test")
import ArchAxis
ArchAxis._Axis(o)
ArchAxis._ViewProviderAxis(o.ViewObject)
o.Distances=[500,500]
o.Angles=[0,0]
App.ActiveDocument.recompute()
Gui.SendMsgToActiveView("ViewFit")
sure

- start FreeCAD
- make a new Document

Code: Select all

Python 2.7.8 (default, Nov 17 2014, 20:37:05) [MSC v.1800 64 bit (AMD64)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> o = App.ActiveDocument.addObject("App::FeaturePython","test")
>>> import ArchAxis
>>> ArchAxis._Axis(o)
<ArchAxis._Axis instance at 0x0000000009176B88>
>>> ArchAxis._ViewProviderAxis(o.ViewObject)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Daten\FreeCAD_0.16.6397_x64_dev_bin\Mod\Arch\ArchAxis.py", line 141, in __init__
    vobj.Proxy = self
Base.FreeCADError: Unknown C++ exception
>>> o.Distances=[500,500]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: Property 'Distances': type in list must be float, not int
>>> o.Angles=[0,0]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: Property 'Angles': type in list must be float, not int
>>> App.ActiveDocument.recompute()
>>> Gui.SendMsgToActiveView("ViewFit")
>>> 
Post Reply