Added name parameter to operation proxy constructor.
This commit is contained in:
@@ -122,6 +122,6 @@ class ObjectChamfer(PathEngraveBase.ObjectOp):
|
||||
def Create(name):
|
||||
'''Create(name) ... Creates and returns a Chamfer operation.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
|
||||
proxy = ObjectChamfer(obj)
|
||||
proxy = ObjectChamfer(obj, name)
|
||||
return obj
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ class ObjectDrilling(PathCircularHoleBase.ObjectOp):
|
||||
def Create(name):
|
||||
'''Create(name) ... Creates and returns a Drilling operation.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
|
||||
proxy = ObjectDrilling(obj)
|
||||
proxy = ObjectDrilling(obj, name)
|
||||
if obj.Proxy:
|
||||
proxy.findAllHoles(obj)
|
||||
return obj
|
||||
|
||||
@@ -153,6 +153,6 @@ class ObjectEngrave(PathEngraveBase.ObjectOp):
|
||||
def Create(name):
|
||||
'''Create(name) ... Creates and returns an Engrave operation.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
|
||||
proxy = ObjectEngrave(obj)
|
||||
proxy = ObjectEngrave(obj, name)
|
||||
return obj
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp):
|
||||
def Create(name):
|
||||
'''Create(name) ... Creates and returns a Helix operation.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
|
||||
proxy = ObjectHelix(obj)
|
||||
proxy = ObjectHelix(obj, name)
|
||||
if obj.Proxy:
|
||||
proxy.findAllHoles(obj)
|
||||
return obj
|
||||
|
||||
@@ -143,5 +143,5 @@ class ObjectFace(PathPocketBase.ObjectPocket):
|
||||
def Create(name):
|
||||
'''Create(name) ... Creates and returns a Mill Facing operation.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
|
||||
proxy = ObjectFace(obj)
|
||||
proxy = ObjectFace(obj, name)
|
||||
return obj
|
||||
|
||||
@@ -114,7 +114,7 @@ class ObjectOp(object):
|
||||
obj.addProperty("App::PropertyDistance", "OpStockZMin", "Op Values", QtCore.QT_TRANSLATE_NOOP("PathOp", "Holds the min Z value of Stock"))
|
||||
obj.setEditorMode('OpStockZMin', 1) # read-only
|
||||
|
||||
def __init__(self, obj):
|
||||
def __init__(self, obj, name):
|
||||
PathLog.track()
|
||||
|
||||
obj.addProperty("App::PropertyBool", "Active", "Path", QtCore.QT_TRANSLATE_NOOP("PathOp", "Make False, to prevent operation from generating code"))
|
||||
|
||||
@@ -96,5 +96,5 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
|
||||
def Create(name):
|
||||
'''Create(name) ... Creates and returns a Pocket operation.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
|
||||
proxy = ObjectPocket(obj)
|
||||
proxy = ObjectPocket(obj, name)
|
||||
return obj
|
||||
|
||||
@@ -170,5 +170,5 @@ def Create(name, obj=None):
|
||||
'''Create(name) ... Creates and returns a Pocket operation.'''
|
||||
if obj is None:
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
|
||||
proxy = ObjectPocket(obj)
|
||||
proxy = ObjectPocket(obj, name)
|
||||
return obj
|
||||
|
||||
@@ -112,5 +112,5 @@ class ObjectContour(PathProfileBase.ObjectProfile):
|
||||
def Create(name):
|
||||
'''Create(name) ... Creates and returns a Contour operation.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
|
||||
proxy = ObjectContour(obj)
|
||||
proxy = ObjectContour(obj, name)
|
||||
return obj
|
||||
|
||||
@@ -103,5 +103,5 @@ class ObjectProfile(PathProfileBase.ObjectProfile):
|
||||
def Create(name):
|
||||
'''Create(name) ... Creates and returns a Profile based on edges operation.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
|
||||
proxy = ObjectProfile(obj)
|
||||
proxy = ObjectProfile(obj, name)
|
||||
return obj
|
||||
|
||||
@@ -141,5 +141,5 @@ class ObjectProfile(PathProfileBase.ObjectProfile):
|
||||
def Create(name):
|
||||
'''Create(name) ... Creates and returns a Profile based on faces operation.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
|
||||
proxy = ObjectProfile(obj)
|
||||
proxy = ObjectProfile(obj, name)
|
||||
return obj
|
||||
|
||||
@@ -290,8 +290,8 @@ class TaskPanel:
|
||||
def Create(name = 'SetupSheet'):
|
||||
'''Create(name = 'SetupSheet') ... creates a new setup sheet'''
|
||||
FreeCAD.ActiveDocument.openTransaction(translate("Path_Job", "Create Job"))
|
||||
ssheet = SetupSheet.Create(name)
|
||||
PathIconViewProvider.Attach(ssheet)
|
||||
ssheet = PathSetupSheet.Create(name)
|
||||
PathIconViewProvider.Attach(ssheet, name)
|
||||
return ssheet
|
||||
|
||||
PathIconViewProvider.RegisterViewProvider('SetupSheet', ViewProvider)
|
||||
|
||||
@@ -323,5 +323,5 @@ class ObjectSurface(PathOp.ObjectOp):
|
||||
def Create(name):
|
||||
'''Create(name) ... Creates and returns a Surface operation.'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
|
||||
proxy = ObjectSurface(obj)
|
||||
proxy = ObjectSurface(obj, name)
|
||||
return obj
|
||||
|
||||
Reference in New Issue
Block a user