Fix bug where removing objects could leave orphaned annotation relationships

This commit is contained in:
Dion Moult
2023-03-19 15:17:26 +11:00
parent 558aff72a0
commit 3da718a6d1
2 changed files with 12 additions and 0 deletions
@@ -130,4 +130,9 @@ class Usecase:
elif inverse.is_a("IfcRelAssignsToGroup"):
if len(inverse.RelatedObjects) == 1:
self.file.remove(inverse)
elif inverse.is_a("IfcRelAssignsToProduct"):
if inverse.RelatingProduct == self.settings["product"]:
self.file.remove(inverse)
elif len(inverse.RelatedObject) == 1:
self.file.remove(inverse)
self.file.remove(self.settings["product"])