Arch: Fixed bug that builds a structure on top of another structure

This commit is contained in:
Yorik van Havre 2013-10-08 16:31:02 -03:00
parent 1e860356e7
commit dceed60c98

View File

@ -352,6 +352,7 @@ class _CommandStructure:
self.continueCmd = False
sel = FreeCADGui.Selection.getSelection()
if sel:
if Draft.getType(sel[0]) != "Structure":
# direct creation
FreeCAD.ActiveDocument.openTransaction(str(translate("Arch","Create Structure")))
FreeCADGui.doCommand("import Arch")
@ -366,7 +367,8 @@ class _CommandStructure:
FreeCADGui.doCommand("Arch.makeStructure(FreeCAD.ActiveDocument." + obj.Name + ")")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
else:
return
# interactive mode
if hasattr(FreeCAD,"DraftWorkingPlane"):
FreeCAD.DraftWorkingPlane.setup()