Skip to content

Commit

Permalink
Arch: Fixed cutplane bug - fixes #3082
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Aug 16, 2017
1 parent aa82216 commit 0adf582
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/Mod/Arch/ArchCutPlane.py
Expand Up @@ -102,14 +102,22 @@ def __init__(self):
self.retranslateUi(self.form)
self.previewCutVolume(self.combobox.currentIndex())

def isAllowedAlterSelection(self):
return False

def accept(self):
FreeCAD.ActiveDocument.removeObject(self.previewObj.Name)
val = self.combobox.currentIndex()
FreeCAD.ActiveDocument.openTransaction(str(translate("Arch","Cutting")))
FreeCADGui.addModule("Arch")
FreeCADGui.doCommand("Arch.cutComponentwithPlane(FreeCADGui.Selection.getSelectionEx()[0],FreeCADGui.Selection.getSelectionEx()[1].SubObjects[0],"+ str(val) +")")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
s = FreeCADGui.Selection.getSelectionEx()
if len(s) > 1:
if s[1].SubObjects:
FreeCAD.ActiveDocument.openTransaction(str(translate("Arch","Cutting")))
FreeCADGui.addModule("Arch")
FreeCADGui.doCommand("Arch.cutComponentwithPlane(FreeCADGui.Selection.getSelectionEx()[0],FreeCADGui.Selection.getSelectionEx()[1].SubObjects[0],"+ str(val) +")")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
return True
FreeCAD.Console.PrintError("Wrong selection\n")
return True

def reject(self):
Expand Down

0 comments on commit 0adf582

Please sign in to comment.