mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 18:22:30 +00:00
root.remove_product to consider IfcRelConnectsPortToElement
This commit is contained in:
@@ -183,6 +183,14 @@ def remove_product(file: ifcopenshell.file, product: ifcopenshell.entity_instanc
|
|||||||
file.remove(inverse)
|
file.remove(inverse)
|
||||||
if history:
|
if history:
|
||||||
ifcopenshell.util.element.remove_deep2(file, history)
|
ifcopenshell.util.element.remove_deep2(file, history)
|
||||||
|
elif inverse.is_a("IfcRelConnectsPortToElement"):
|
||||||
|
if inverse.RelatedElement == settings["product"]:
|
||||||
|
ifcopenshell.api.run("root.remove_product", file, product=inverse.RelatingPort)
|
||||||
|
elif inverse.RelatingPort == settings["product"]:
|
||||||
|
history = inverse.OwnerHistory
|
||||||
|
file.remove(inverse)
|
||||||
|
if history:
|
||||||
|
ifcopenshell.util.element.remove_deep2(file, history)
|
||||||
elif inverse.is_a("IfcRelConnectsPorts"):
|
elif inverse.is_a("IfcRelConnectsPorts"):
|
||||||
if settings["product"] not in (inverse.RelatingPort, inverse.RelatedPort):
|
if settings["product"] not in (inverse.RelatingPort, inverse.RelatedPort):
|
||||||
# if it's not RelatingPort/RelatedPort then it's optional RealizingElement
|
# if it's not RelatingPort/RelatedPort then it's optional RealizingElement
|
||||||
|
|||||||
Reference in New Issue
Block a user