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
@@ -1,3 +1,6 @@
import ifcopenshell.api
class Usecase:
def __init__(self, file, **settings):
self.file = file
@@ -15,6 +18,6 @@ class Usecase:
if rel.RelatingOpeningElement == self.settings["opening"]:
to_remove.append(rel)
break
self.file.remove(self.settings["opening"])
ifcopenshell.api.run("root.remove_product", self.file, product=self.settings["opening"])
for element in to_remove:
self.file.remove(element)