From b1e4864910ceaf4f9b27033ea93b7f8e06eff657 Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Sat, 26 Mar 2022 09:53:55 -0500 Subject: [PATCH] Path: Allow GUI Job creation without task panel interaction These changes allow for a Job object to be created with view provider support, but without the initial task panel interaction at creation. This is useful for scripting and other internal Job creation tasks. --- src/Mod/Path/PathScripts/PathJobGui.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)