mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Fix bug where linking an element twice caused stacked undos to fail. See #2200.
This commit is contained in:
@@ -277,6 +277,11 @@ class IfcStore:
|
||||
|
||||
@staticmethod
|
||||
def link_element(element, obj):
|
||||
existing_obj = IfcStore.id_map.get(element.id(), None)
|
||||
if existing_obj == obj:
|
||||
return
|
||||
elif existing_obj:
|
||||
IfcStore.unlink_element(obj=existing_obj)
|
||||
IfcStore.id_map[element.id()] = obj
|
||||
if hasattr(element, "GlobalId"):
|
||||
IfcStore.guid_map[element.GlobalId] = obj
|
||||
|
||||
Reference in New Issue
Block a user