BIM: add missing imports for Arch_CutPlane (#14430)

* BIM: add missing imports

* BIM: import correct module for cutComponentwithPlane

* Move PySide imports inside class methods
This commit is contained in:
Furgo
2024-06-10 18:27:25 +02:00
committed by GitHub
parent a30d3801b0
commit 616f4971ce

View File

@@ -65,6 +65,7 @@ class Arch_CutPlane:
class CutPlaneTaskPanel:
def __init__(self):
import ArchCutPlane
from PySide import QtCore, QtGui
_, self.base, self.cutter = ArchCutPlane._getShapes(FreeCADGui.Selection.getSelectionEx("", 0))
self.previewObj = FreeCAD.ActiveDocument.addObject("Part::Feature", "PreviewCutVolume")
@@ -93,9 +94,9 @@ class CutPlaneTaskPanel:
FreeCAD.ActiveDocument.removeObject(self.previewObj.Name)
side = self.combobox.currentIndex()
FreeCAD.ActiveDocument.openTransaction(translate("Arch", "Cutting"))
FreeCADGui.addModule("Arch")
FreeCADGui.addModule("ArchCutPlane")
FreeCADGui.doCommand("sels = FreeCADGui.Selection.getSelectionEx('', 0)")
FreeCADGui.doCommand("Arch.cutComponentwithPlane(sels, side=" + str(side) + ")")
FreeCADGui.doCommand("ArchCutPlane.cutComponentwithPlane(sels, side=" + str(side) + ")")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
return True