diff --git a/src/Mod/Path/PathScripts/PathJobGui.py b/src/Mod/Path/PathScripts/PathJobGui.py index b1ae35eff1..8ea9cb60ab 100644 --- a/src/Mod/Path/PathScripts/PathJobGui.py +++ b/src/Mod/Path/PathScripts/PathJobGui.py @@ -1631,7 +1631,7 @@ class TaskPanel: self.updateSelection() -def Create(base, template=None): +def Create(base, template=None, openTaskPanel=True): """Create(base, template) ... creates a job instance for the given base object using template to configure it.""" FreeCADGui.addModule("PathScripts.PathJob") @@ -1642,7 +1642,10 @@ def Create(base, template=None): obj.ViewObject.addExtension("Gui::ViewProviderGroupExtensionPython") FreeCAD.ActiveDocument.commitTransaction() obj.Document.recompute() - obj.ViewObject.Proxy.editObject(obj.Stock) + if openTaskPanel: + obj.ViewObject.Proxy.editObject(obj.Stock) + else: + obj.ViewObject.Proxy.deleteOnReject = False return obj except Exception as exc: PathLog.error(exc)