mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
root.remove_product to remove IfcRelConnectsPorts too
previously if you deleted some flow segment that was connected to another the connection would stay resulting in invalid ifc and other bugs
This commit is contained in:
@@ -132,6 +132,12 @@ class Usecase:
|
||||
):
|
||||
continue
|
||||
self.file.remove(inverse)
|
||||
elif inverse.is_a("IfcRelConnectsPorts"):
|
||||
if self.settings["product"] not in (inverse.RelatingPort, inverse.RelatedPort):
|
||||
# if it's not RelatingPort/RelatedPort then it's optional RealizingElement
|
||||
# so we keep the relationship
|
||||
continue
|
||||
self.file.remove(inverse)
|
||||
elif inverse.is_a("IfcRelAssignsToGroup"):
|
||||
if len(inverse.RelatedObjects) == 1:
|
||||
self.file.remove(inverse)
|
||||
|
||||
Reference in New Issue
Block a user