Merge pull request #4911 from sliptonic/feature/nopathjob
[Path] Make Job and Operation visibility more natural
This commit is contained in:
@@ -281,12 +281,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
|
||||
@@ -658,7 +659,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):
|
||||
@@ -708,7 +709,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
|
||||
@@ -848,5 +849,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
|
||||
|
||||
Reference in New Issue
Block a user