mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 10:57:49 +00:00
Fix #6873. Bug where geometry created through sync_references didn't have item editing metadata.
This commit is contained in:
@@ -72,6 +72,10 @@ def assign_class(
|
||||
"""
|
||||
Args:
|
||||
context: is not optional if `should_add_representation` is True
|
||||
|
||||
TODO: Do NOT use should_add_representation. Because it internally calls
|
||||
geometry.add_representation which is 1,000 lines of Blender -> IFC magic.
|
||||
Instead, explicitly create a representation using tool.Geometry.
|
||||
"""
|
||||
if ifc.get_entity(obj):
|
||||
return
|
||||
|
||||
@@ -1552,12 +1552,10 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
context=context,
|
||||
ifc_representation_class=None,
|
||||
)
|
||||
if representation := ifcopenshell.util.representation.get_representation(element, context):
|
||||
cls.reload_representation(obj=obj, representation=representation)
|
||||
bpy.data.curves.remove(data)
|
||||
|
||||
assert element
|
||||
representation = ifcopenshell.util.representation.get_representation(element, context)
|
||||
assert representation
|
||||
obj.data["ios_edges_item_ids"] = (representation.Items[0].id(),)
|
||||
return element
|
||||
|
||||
@classmethod
|
||||
@@ -1645,6 +1643,8 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
context=context,
|
||||
ifc_representation_class=None,
|
||||
)
|
||||
if representation := ifcopenshell.util.representation.get_representation(element, context):
|
||||
cls.reload_representation(obj=obj, representation=representation)
|
||||
return element
|
||||
|
||||
@classmethod
|
||||
@@ -1682,6 +1682,8 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
context=context,
|
||||
ifc_representation_class=None,
|
||||
)
|
||||
if representation := ifcopenshell.util.representation.get_representation(element, context):
|
||||
cls.reload_representation(obj=obj, representation=representation)
|
||||
return element
|
||||
|
||||
@classmethod
|
||||
@@ -1782,6 +1784,8 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
context=context,
|
||||
ifc_representation_class=None,
|
||||
)
|
||||
if representation := ifcopenshell.util.representation.get_representation(element, context):
|
||||
cls.reload_representation(obj=obj, representation=representation)
|
||||
return element
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user