remove_product to remove IfcRelConnectsElements

This commit is contained in:
Andrej730
2023-07-14 10:20:30 +05:00
parent 2fa7cbaabf
commit 6810bbff2f
3 changed files with 39 additions and 6 deletions
@@ -125,7 +125,11 @@ class Usecase:
elif inverse.is_a("IfcRelContainedInSpatialStructure"):
if inverse.RelatingStructure == self.settings["product"] or len(inverse.RelatedElements) == 1:
self.file.remove(inverse)
elif inverse.is_a("IfcRelConnectsPathElements"):
elif inverse.is_a() in ("IfcRelConnectsElements", "IfcRelConnectsPathElements"):
if inverse.is_a("IfcRelConnectsWithRealizingElements"):
connected_elements = (inverse.RelatingElement, inverse.RelatedElement)
if any(el not in connected_elements for el in inverse.RealizingElements):
continue
self.file.remove(inverse)
elif inverse.is_a("IfcRelAssignsToGroup"):
if len(inverse.RelatedObjects) == 1: