My problem function boolean "cut"
Code: Select all
import FreeCAD, FreeCADGui, Part
App = FreeCAD
Gui = FreeCADGui
class BoolTool():
def __init__(self, name):
self.name = name
self.obj = None
def cut(self, Base, Tool):
obj = App.ActiveDocument.addObject("Part::Cut", self.name)
obj.Base = Base
obj.Tool = Tool
obj.Refine = True
App.ActiveDocument.recompute()
self.obj = obj
return obj
Code: Select all
<Exception> type must be 'DocumentObject' or 'NoneType', not str
Code: Select all
cut1 = BoolTool("cut1")
cut1.cut("Box1","Cylinder1")
snippet console freecad python box e cylinder :
Code: Select all
App.activeDocument().addObject("Part::Cut","Cut")
App.activeDocument().Cut.Base = App.activeDocument().Box1
App.activeDocument().Cut.Tool = App.activeDocument().Cylinder1
my code problem . any solved problem ?
thanks.
i'am italian my english school.