Arch/rebar broken in 0.17 (with fix ?)

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
fredko
Posts: 26
Joined: Thu Dec 11, 2014 9:11 am

Arch/rebar broken in 0.17 (with fix ?)

Post by fredko »

Hi,
I've tried Arch/rebar in 0.17.7447 and the command doesn't work (error when exiting the sketch) :
Running the Python command 'Arch_Rebar' failed:
Traceback (most recent call last):
File "D:\Utilisateurs\behe\Desktop\prog-supp\Freecad\FreeCAD_0.17.7447_x64_dev_win\FreeCAD_0.17.7447_x64_dev_win\Mod\Arch\ArchRebar.py", line 129, in Activated
FreeCADGui.doCommand("Arch.makeRebar(FreeCAD.ActiveDocument."+sup.Name+",FreeCAD.ActiveDocument."+obj.Name+")")

'list' object has no attribute 'Name'Arch workbench deactivated
It seems that the type of sketch.support has changed (since PD Next I suppose). It's now an empty list when sketch has no support and a tuple in a list when sketch has a support (was a tuple before).

So I've change two lines of code in ArchRebar.py (since line 121) :

Code: Select all

                if hasattr(obj,"Support"):
                    if obj.Support:
                        #if isinstance(obj.Support,tuple):
                        if len(obj.Support) !=0 :
                            #sup = obj.Support[0]
                            sup=obj.Support[0][0]
Now it seems to work as before (with the same little bug with the new behavior avoiding cycling dependency (default but I don't use it)), but not sure it's right.
If someone could have a look...
Thanks.
User avatar
yorik
Founder
Posts: 13660
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Arch/rebar broken in 0.17 (with fix ?)

Post by yorik »

Fixed in git commit eca3ce2. Thanks!
Post Reply