Arch: Fixed cutplane bug - fixes #3082

This commit is contained in:
Yorik van Havre
2017-08-16 18:31:17 -03:00
parent aa82216411
commit 0adf582b1c

View File

@@ -102,14 +102,22 @@ class _CutPlaneTaskPanel:
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):