See #3974. WIP review to ensure history removal in API.

This commit is contained in:
Dion Moult
2023-11-27 18:31:42 +11:00
parent f215670381
commit 14f1acadb7
22 changed files with 174 additions and 5 deletions
@@ -18,6 +18,7 @@
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
class Usecase:
@@ -57,7 +58,16 @@ class Usecase:
)
elif inverse.is_a("IfcRelAssignsToGroup"):
if inverse.RelatingGroup == self.settings["group"]:
history = inverse.OwnerHistory
self.file.remove(inverse)
if history:
ifcopenshell.util.element.remove_deep2(self.file, history)
elif len(inverse.RelatedObjects) == 1:
history = inverse.OwnerHistory
self.file.remove(inverse)
if history:
ifcopenshell.util.element.remove_deep2(self.file, history)
history = self.settings["group"].OwnerHistory
self.file.remove(self.settings["group"])
if history:
ifcopenshell.util.element.remove_deep2(self.file, history)