FEM: Make view proxy optional on object creation
This commit is contained in:
committed by
Bernd Hahnebach
parent
d0b7472ab1
commit
f5e67238ef
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user