Draft: change DisplayMode only if the interface is up (FreeCAD.GuiUp)

This commit is contained in:
vocx-fc
2019-10-23 00:00:12 -05:00
committed by Yorik van Havre
parent 1bc33025d6
commit 210dfbf13a

View File

@@ -2148,7 +2148,8 @@ def draftify(objectslist,makeblock=False,delete=True):
newobjlist.append(nobj)
formatObject(nobj,obj)
# sketches are always in wireframe mode. In Draft we don't like that!
nobj.ViewObject.DisplayMode = "Flat Lines"
if FreeCAD.GuiUp:
nobj.ViewObject.DisplayMode = "Flat Lines"
if delete:
FreeCAD.ActiveDocument.removeObject(obj.Name)