mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Fix bug where removing an element in an aggregation could leave the file in an invalid state
This commit is contained in:
@@ -64,4 +64,9 @@ class Usecase:
|
||||
ifcopenshell.api.run("root.remove_product", self.file, product=subelement)
|
||||
if not inverse.RelatedObjects:
|
||||
self.file.remove(inverse)
|
||||
elif inverse.is_a("IfcRelAggregates"):
|
||||
if inverse.RelatingObject == self.settings["product"]:
|
||||
self.file.remove(inverse)
|
||||
elif len(inverse.RelatedObjects) == 1:
|
||||
self.file.remove(inverse)
|
||||
self.file.remove(self.settings["product"])
|
||||
|
||||
Reference in New Issue
Block a user