mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Deleting an element now also auto deletes its associated distribution ports
This commit is contained in:
@@ -57,4 +57,11 @@ class Usecase:
|
||||
self.file.remove(inverse)
|
||||
elif inverse.is_a("IfcRelVoidsElement"):
|
||||
self.file.remove(inverse)
|
||||
elif inverse.is_a("IfcRelNests"):
|
||||
if inverse.RelatingObject == self.settings["product"]:
|
||||
for subelement in inverse.RelatedObjects:
|
||||
if subelement.is_a("IfcDistributionPort"):
|
||||
ifcopenshell.api.run("root.remove_product", self.file, product=subelement)
|
||||
if not inverse.RelatedObjects:
|
||||
self.file.remove(inverse)
|
||||
self.file.remove(self.settings["product"])
|
||||
|
||||
Reference in New Issue
Block a user