Make job work more naturally

Operations Group as document group
Make job claim children

[Path] Make Operations into a document group
This commit is contained in:
sliptonic
2021-07-07 22:05:23 -05:00
parent 61a7654094
commit de75035ece
3 changed files with 21 additions and 8 deletions

View File

@@ -282,12 +282,13 @@ class ObjectJob:
def setupOperations(self, obj):
"""setupOperations(obj)... setup the Operations group for the Job object."""
ops = FreeCAD.ActiveDocument.addObject(
"Path::FeatureCompoundPython", "Operations"
)
# ops = FreeCAD.ActiveDocument.addObject(
# "Path::FeatureCompoundPython", "Operations"
# )
ops = FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup","Operations")
if ops.ViewObject:
ops.ViewObject.Proxy = 0
ops.ViewObject.Visibility = False
# ops.ViewObject.Proxy = 0
ops.ViewObject.Visibility = True
obj.Operations = ops
obj.setEditorMode("Operations", 2) # hide
@@ -659,7 +660,7 @@ class ObjectJob:
def execute(self, obj):
if getattr(obj, "Operations", None):
obj.Path = obj.Operations.Path
#obj.Path = obj.Operations.Path
self.getCycleTime()
def getCycleTime(self):
@@ -709,7 +710,7 @@ class ObjectJob:
else:
group.append(op)
self.obj.Operations.Group = group
op.Path.Center = self.obj.Operations.Path.Center
# op.Path.Center = self.obj.Operations.Path.Center
def nextToolNumber(self):
# returns the next available toolnumber in the job
@@ -849,5 +850,6 @@ def Create(name, base, templateFile=None):
else:
models = base
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
obj.addExtension("App::GroupExtensionPython")
obj.Proxy = ObjectJob(obj, models, templateFile)
return obj