import DraftTools if Snapper isn't loaded yet (before using it)
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user