From 394a885929cd8d04c29cbe7b52048d9d501db78e Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 7 Feb 2021 12:38:39 -0800 Subject: [PATCH] import DraftTools if Snapper isn't loaded yet (before using it) --- src/Mod/Path/PathScripts/PathGetPoint.py | 5 +++++ src/Mod/Path/PathScripts/PathOpGui.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/Mod/Path/PathScripts/PathGetPoint.py b/src/Mod/Path/PathScripts/PathGetPoint.py index 402a62f21e..a211e5d49e 100644 --- a/src/Mod/Path/PathScripts/PathGetPoint.py +++ b/src/Mod/Path/PathScripts/PathGetPoint.py @@ -106,6 +106,10 @@ class TaskPanel: If start is specified the Snapper UI is closed on the first point the user enters. If start remains None, then Snapper is kept open until the user explicitly closes Snapper. This lets the user enter multiple points in quick succession.''' + # there's no get point without Snapper, if it's not loaded, need to do that explicitly + if not hasattr(FreeCADGui, 'Snapper'): + import DraftTools + def displayPoint(p): self.point = p self.formPoint.globalX.setProperty('rawValue', p.x) @@ -175,6 +179,7 @@ class TaskPanel: if self.buttonBox: self.buttonBox.setEnabled(False) + FreeCADGui.Snapper.forceGridOff=True def pointFinish(self, ok, cleanup = True): diff --git a/src/Mod/Path/PathScripts/PathOpGui.py b/src/Mod/Path/PathScripts/PathOpGui.py index 0aa304a5fc..f98a85453b 100644 --- a/src/Mod/Path/PathScripts/PathOpGui.py +++ b/src/Mod/Path/PathScripts/PathOpGui.py @@ -1265,6 +1265,8 @@ class CommandSetStartPoint: obj.StartPoint.z = obj.ClearanceHeight.Value def Activated(self): + if not hasattr(FreeCADGui, 'Snapper'): + import DraftTools FreeCADGui.Snapper.getPoint(callback=self.setpoint)