Skip to content

Commit

Permalink
Arch: Fixed bug in removing objects from section planes
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Jun 15, 2018
1 parent 9e7f406 commit 8e4dd8c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Mod/Arch/ArchCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ def removeComponents(objectsList,host=None):
if not Draft.getType(o) in ["Window","Roof"]:
setAsSubcomponent(o)
host.Subtractions = s
elif Draft.getType(host) in ["SectionPlane"]:
a = host.Objects
for o in objectsList:
if o in a:
a.remove(o)
host.Objects = a
else:
for o in objectsList:
if o.InList:
Expand Down Expand Up @@ -1319,7 +1325,7 @@ def Activated(self):
FreeCADGui.doCommand("Arch.removeSpaceBoundaries( FreeCAD.ActiveDocument."+sel[-1].Name+", FreeCADGui.Selection.getSelection() )")
else:
FreeCAD.ActiveDocument.openTransaction(translate("Arch","Ungrouping"))
if (Draft.getType(sel[-1]) in ["Wall","Structure","Stairs","Roof","Window","Panel"]) and (len(sel) > 1):
if len(sel) > 1:
host = sel.pop()
ss = "["
for o in sel:
Expand All @@ -1331,7 +1337,7 @@ def Activated(self):
FreeCADGui.doCommand("Arch.removeComponents("+ss+",FreeCAD.ActiveDocument."+host.Name+")")
else:
FreeCADGui.addModule("Arch")
FreeCADGui.doCommand("Arch.removeComponents(FreeCAD.ActiveDocument."+sel[-1].Name+")")
FreeCADGui.doCommand("Arch.removeComponents(FreeCAD.ActiveDocument."+sel[0].Name+")")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()

Expand Down

0 comments on commit 8e4dd8c

Please sign in to comment.