mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 19:27:10 +00:00
Fix parametric stairs/railings/roofs not updating ifc link after representation update #6264
Related to 3107fd9
This commit is contained in:
@@ -1002,8 +1002,11 @@ class Model(bonsai.core.tool.Model):
|
|||||||
obj: bpy.types.Object,
|
obj: bpy.types.Object,
|
||||||
new_representation: ifcopenshell.entity_instance,
|
new_representation: ifcopenshell.entity_instance,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
mesh = obj.data
|
||||||
|
assert isinstance(mesh, bpy.types.Mesh)
|
||||||
ifc_file = tool.Ifc.get()
|
ifc_file = tool.Ifc.get()
|
||||||
ifc_element = tool.Ifc.get_entity(obj)
|
ifc_element = tool.Ifc.get_entity(obj)
|
||||||
|
assert ifc_element
|
||||||
old_representation = ifcopenshell.util.representation.get_representation(
|
old_representation = ifcopenshell.util.representation.get_representation(
|
||||||
ifc_element, ifc_context.ContextType, ifc_context.ContextIdentifier, ifc_context.TargetView
|
ifc_element, ifc_context.ContextType, ifc_context.ContextIdentifier, ifc_context.TargetView
|
||||||
)
|
)
|
||||||
@@ -1017,6 +1020,15 @@ class Model(bonsai.core.tool.Model):
|
|||||||
ifcopenshell.api.run(
|
ifcopenshell.api.run(
|
||||||
"geometry.assign_representation", ifc_file, product=ifc_element, representation=new_representation
|
"geometry.assign_representation", ifc_file, product=ifc_element, representation=new_representation
|
||||||
)
|
)
|
||||||
|
bonsai.core.geometry.switch_representation(
|
||||||
|
tool.Ifc,
|
||||||
|
tool.Geometry,
|
||||||
|
obj=obj,
|
||||||
|
representation=new_representation,
|
||||||
|
should_reload=True,
|
||||||
|
is_global=True,
|
||||||
|
should_sync_changes_first=False,
|
||||||
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def update_thumbnail_for_element(cls, element: ifcopenshell.entity_instance, refresh: bool = False) -> None:
|
def update_thumbnail_for_element(cls, element: ifcopenshell.entity_instance, refresh: bool = False) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user