BIM: Make sure we have a default context when exporting to IFC
This commit is contained in:
committed by
Chris Hennes
parent
f639705762
commit
ead1c43de9
@@ -127,6 +127,13 @@ def get_export_preferences(ifcfile, preferred_context=None, create=None):
|
||||
best_context = ifc_tools.api_run("context.add_context",
|
||||
ifcfile,
|
||||
context_type = preferred_context[0])
|
||||
if not best_context:
|
||||
if contexts:
|
||||
best_context = contexts[0]
|
||||
else:
|
||||
best_context = ifc_tools.api_run("context.add_context",
|
||||
ifcfile,
|
||||
context_type = "Model")
|
||||
return prefs, best_context
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user