Fix bug where linking an element twice caused stacked undos to fail. See #2200.

This commit is contained in:
Dion Moult
2022-10-04 14:23:02 +11:00
parent e74eb0cc53
commit 7d63b03dd3
+5
View File
@@ -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