mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 06:18:09 +00:00
fix error reloading representation for objects without representation
This commit is contained in:
@@ -26,6 +26,7 @@ import ifcopenshell
|
|||||||
import blenderbim.core.tool
|
import blenderbim.core.tool
|
||||||
import blenderbim.core.style
|
import blenderbim.core.style
|
||||||
import blenderbim.core.spatial
|
import blenderbim.core.spatial
|
||||||
|
import blenderbim.core.geometry
|
||||||
import blenderbim.tool as tool
|
import blenderbim.tool as tool
|
||||||
import blenderbim.bim.import_ifc
|
import blenderbim.bim.import_ifc
|
||||||
from math import radians, pi
|
from math import radians, pi
|
||||||
@@ -723,6 +724,9 @@ class Geometry(blenderbim.core.tool.Geometry):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def reload_representation(cls, obj):
|
def reload_representation(cls, obj):
|
||||||
|
"""reload `obj` active representation"""
|
||||||
|
if not obj.data:
|
||||||
|
return
|
||||||
representation = tool.Ifc.get().by_id(obj.data.BIMMeshProperties.ifc_definition_id)
|
representation = tool.Ifc.get().by_id(obj.data.BIMMeshProperties.ifc_definition_id)
|
||||||
blenderbim.core.geometry.switch_representation(
|
blenderbim.core.geometry.switch_representation(
|
||||||
tool.Ifc,
|
tool.Ifc,
|
||||||
|
|||||||
Reference in New Issue
Block a user