fix error reloading representation for objects without representation

This commit is contained in:
Andrej730
2024-03-11 11:21:06 +05:00
parent 301ddab1ee
commit ddfaf3308b
@@ -26,6 +26,7 @@ import ifcopenshell
import blenderbim.core.tool
import blenderbim.core.style
import blenderbim.core.spatial
import blenderbim.core.geometry
import blenderbim.tool as tool
import blenderbim.bim.import_ifc
from math import radians, pi
@@ -723,6 +724,9 @@ class Geometry(blenderbim.core.tool.Geometry):
@classmethod
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)
blenderbim.core.geometry.switch_representation(
tool.Ifc,