mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
See #3974. WIP review to ensure history removal in API.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.util.element
|
||||
|
||||
|
||||
class Usecase:
|
||||
@@ -59,7 +60,16 @@ class Usecase:
|
||||
)
|
||||
elif inverse.is_a("IfcRelAssignsToGroup"):
|
||||
if inverse.RelatingGroup == self.settings["system"]:
|
||||
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["system"].OwnerHistory
|
||||
self.file.remove(self.settings["system"])
|
||||
if history:
|
||||
ifcopenshell.util.element.remove_deep2(self.file, history)
|
||||
|
||||
Reference in New Issue
Block a user