From afb3d998c8019dc6f2753c028e928f6c8b05484e Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 22 Aug 2021 22:02:22 +1000 Subject: [PATCH] Rudimentary handling of purging voids and fills --- .../ifcopenshell/api/root/remove_product.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/api/root/remove_product.py b/src/ifcopenshell-python/ifcopenshell/api/root/remove_product.py index e63bcda37e..378c9cb30e 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/root/remove_product.py +++ b/src/ifcopenshell-python/ifcopenshell/api/root/remove_product.py @@ -34,4 +34,9 @@ class Usecase: ifcopenshell.api.run("grid.remove_grid_axis", self.file, axis=axis) # TODO: remove object placement and other relationships + for inverse in self.file.get_inverse(self.settings["product"]): + if inverse.is_a("IfcRelFillsElement"): + self.file.remove(inverse) + elif inverse.is_a("IfcRelVoidsElement"): + self.file.remove(inverse) self.file.remove(self.settings["product"])