lack of Arch module support in freecadcmd

Need help, or want to share a macro? Post here!
Taufeeq2
Posts: 18
Joined: Fri Mar 30, 2018 12:39 pm

lack of Arch module support in freecadcmd

Postby Taufeeq2 » Fri May 04, 2018 3:48 pm

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
Site Admin
Posts: 11566
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: lack of Arch module support in freecadcmd

Postby yorik » Fri May 04, 2018 6:56 pm

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

Postby Taufeeq2 » Mon May 07, 2018 7:18 am

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

Postby Taufeeq2 » Mon May 07, 2018 7:23 am

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
Site Admin
Posts: 11566
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: lack of Arch module support in freecadcmd

Postby yorik » Mon May 07, 2018 2:54 pm

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

Postby Taufeeq2 » Mon May 07, 2018 4:47 pm

The part module works without asking for an active document
User avatar
yorik
Site Admin
Posts: 11566
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: lack of Arch module support in freecadcmd

Postby yorik » Tue May 08, 2018 6:56 pm

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.