Skip to content

Commit

Permalink
Make cutComponent working
Browse files Browse the repository at this point in the history
  • Loading branch information
j-wiedemann authored and yorikvanhavre committed Nov 12, 2014
1 parent b17f401 commit f7830b8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Mod/Arch/ArchCommands.py
Expand Up @@ -394,14 +394,14 @@ def getCutVolume(cutplane,shapes):
return cutface,cutvolume,invcutvolume

def cutComponent(cutPlane, archObject):
"""cut object from a plan"""
cutVolume = Arch.getCutVolume(cutPlane, archObject.Object.Shape)
"""cut object from a plan"""
cutVolume = getCutVolume(cutPlane, archObject.Object.Shape)
cutVolume = cutVolume[2]
if cutVolume:
obj = App.activeDocument().addObject("Part::Feature", "CutVolume")
obj = FreeCAD.ActiveDocument.addObject("Part::Feature", "CutVolume")
obj.Shape = cutVolume
# add substraction component to Arch object
return Arch.removeComponents(obj,archObject.Object)
return removeComponents(obj,archObject.Object)

def getShapeFromMesh(mesh,fast=True,tolerance=0.001,flat=False,cut=True):
import Part, MeshPart, DraftGeomUtils
Expand Down Expand Up @@ -957,7 +957,7 @@ def Activated(self):
archObject = FreeCADGui.Selection.getSelectionEx()[0]
FreeCAD.ActiveDocument.openTransaction(str(translate("Arch","Cutting")))
FreeCADGui.addModule("Arch")
FreeCADGui.doCommand("Arch.cutComponent(face,archObject")
FreeCADGui.doCommand("Arch.cutComponent(FreeCADGui.Selection.getSelectionEx()[1].SubObjects[0],FreeCADGui.Selection.getSelectionEx()[0])")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()

Expand Down Expand Up @@ -1148,6 +1148,7 @@ def Activated(self):
if FreeCAD.GuiUp:
FreeCADGui.addCommand('Arch_Add',_CommandAdd())
FreeCADGui.addCommand('Arch_Remove',_CommandRemove())
FreeCADGui.addCommand('Arch_CutPlane',_CommandCutPlane())
FreeCADGui.addCommand('Arch_SplitMesh',_CommandSplitMesh())
FreeCADGui.addCommand('Arch_MeshToShape',_CommandMeshToShape())
FreeCADGui.addCommand('Arch_SelectNonSolidMeshes',_CommandSelectNonSolidMeshes())
Expand Down

0 comments on commit f7830b8

Please sign in to comment.