lack of Arch module support in freecadcmd

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Taufeeq2
Posts: 18
Joined: Fri Mar 30, 2018 12:39 pm

lack of Arch module support in freecadcmd

Post by Taufeeq2 »

Support for the Arch and Draft module is non existent in Freecadcmd as it requires an active object in the gui.
Any help on work arounds is greatly appreciated!
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: lack of Arch module support in freecadcmd

Post by yorik »

It doesn't. both should work perfectly without the GUI. If any of these give problems, then it's a bug and we need to fix it. What message error does it give?
Taufeeq2
Posts: 18
Joined: Fri Mar 30, 2018 12:39 pm

Re: lack of Arch module support in freecadcmd

Post by Taufeeq2 »

Sorry for the delay, the error shows up both for the Arch module and Draft module,
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/lib/freecad/Mod/Draft/Draft.py", line 891, in makeLine
obj = makeWire([p1,p2])
File "/usr/lib/freecad/Mod/Draft/Draft.py", line 847, in makeWire
obj = FreeCAD.ActiveDocument.addObject("Part::Part2DObjectPython",fname)
AttributeError: 'NoneType' object has no attribute 'addObject'
The error however doesnt show up in the gui
Taufeeq2
Posts: 18
Joined: Fri Mar 30, 2018 12:39 pm

Re: lack of Arch module support in freecadcmd

Post by Taufeeq2 »

Attemping to circumvent the Draft problem using the Part module to make the line then subsequently use the line to make a wall through Arch.makeWall
results in the following error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/lib/freecad/Mod/Arch/ArchWall.py", line 61, in makeWall
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
AttributeError: 'NoneType' object has no attribute 'addObject'

The errors however disappear if there is an active object in the gui.
It should also be noted that almost all methods in Arch module i have tested still spring up errors similar to this. methods including but not limited to Arch.makeStructure
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: lack of Arch module support in freecadcmd

Post by yorik »

Okay, the problem is that you didn't create a document before adding geometry. But indeed all these functions should check that an active document exists and inform the user instead of just bailing out. Will add that ASAP
Taufeeq2
Posts: 18
Joined: Fri Mar 30, 2018 12:39 pm

Re: lack of Arch module support in freecadcmd

Post by Taufeeq2 »

The part module works without asking for an active document
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: lack of Arch module support in freecadcmd

Post by yorik »

yes because the objects you create in Part are not document objects, they dont exist in a document until you attach them manually to an object. The ones you do in Draft and Arch are.
Post Reply