FEM: Make view proxy optional on object creation

This commit is contained in:
Markus Hovorka
2019-09-23 21:16:43 +02:00
committed by Bernd Hahnebach
parent d0b7472ab1
commit f5e67238ef

View File

@@ -45,7 +45,7 @@ if FreeCAD.GuiUp:
from PySide import QtGui
def createObject(doc, name, proxy, viewProxy):
def createObject(doc, name, proxy, viewProxy=None):
""" Add python object to document using python type string.
Add a document object suitable for the *proxy* and the *viewProxy* to *doc*
@@ -64,7 +64,7 @@ def createObject(doc, name, proxy, viewProxy):
"""
obj = doc.addObject(proxy.BaseType, name)
proxy(obj)
if FreeCAD.GuiUp:
if FreeCAD.GuiUp and viewProxy is not None:
viewProxy(obj.ViewObject)
return obj