Removed FreeCADGui dependency if Gui is not up

This commit is contained in:
markus
2019-05-28 18:40:02 -07:00
committed by Markus Lampert
parent f5706be874
commit b27b6d0c1b

View File

@@ -23,12 +23,12 @@
# ***************************************************************************
import FreeCAD
import FreeCADGui
import PathScripts.PathJob as PathJob
def selection():
'''isActive() ... return True if a dressup command is possible.'''
if FreeCAD.ActiveDocument:
if FreeCAD.ActiveDocument and FreeCAD.GuiUp:
import FreeCADGui
sel = FreeCADGui.Selection.getSelectionEx()
if len(sel) == 1 and sel[0].Object.isDerivedFrom("Path::Feature") and PathJob.Instances():
return sel[0].Object