Fix bug where related openings are not deleted when you delete a product

This commit is contained in:
Dion Moult
2021-05-12 22:20:58 +10:00
parent 35ceba2e88
commit beb813cb21
5 changed files with 30 additions and 6 deletions
@@ -22,5 +22,7 @@ class Usecase:
self.file, **{"product": self.settings["product"], "representation": representation}
)
ifcopenshell.api.run("geometry.remove_representation", self.file, **{"representation": representation})
for opening in self.settings["product"].HasOpenings or []:
ifcopenshell.api.run("void.remove_opening", self.file, opening=opening.RelatedOpeningElement)
# TODO: remove object placement and other relationships
self.file.remove(self.settings["product"])