Arch: Fixed rebars to work with PartDesignNext

This commit is contained in:
Yorik van Havre 2016-04-30 10:47:05 -03:00
parent a38a78f6d6
commit eca3ce2dde
No known key found for this signature in database
GPG Key ID: 4C7794EF1595A813

View File

@ -120,10 +120,11 @@ class _CommandRebar:
# we have only the sketch: extract the base object from it
if hasattr(obj,"Support"):
if obj.Support:
if isinstance(obj.Support,tuple):
sup = obj.Support[0]
if len(obj.Support) != 0:
sup = obj.Support[0][0]
else:
sup = obj.Support
print "Arch: error: couldn't extract a base object"
return
FreeCAD.ActiveDocument.openTransaction(translate("Arch","Create Rebar"))
FreeCADGui.addModule("Arch")
FreeCADGui.doCommand("Arch.makeRebar(FreeCAD.ActiveDocument."+sup.Name+",FreeCAD.ActiveDocument."+obj.Name+")")