api.geometry.connect_path: add connection_geometry parameter

IfcRelConnectsPathElements has an optional ConnectionGeometry attribute for
recording the geometric cut-plane between adjacent elements, but there was
no way to set it via the API.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Bruno Postle
2026-03-30 07:30:38 +01:00
parent f46be80193
commit 17eaef778a
2 changed files with 14 additions and 0 deletions
@@ -33,6 +33,18 @@ class TestConnectPath(test.bootstrap.IFC4):
assert rel.RelatedConnectionType == "ATEND"
assert rel.Description == "MITRE"
def test_storing_connection_geometry(self):
wall1 = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcWall")
wall2 = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcWall")
geometry = self.file.create_entity("IfcConnectionPointGeometry")
rel = ifcopenshell.api.geometry.connect_path(
self.file,
relating_element=wall1,
related_element=wall2,
connection_geometry=geometry,
)
assert rel.ConnectionGeometry == geometry
def test_doing_nothing_if_the_element_is_already_connected(self):
wall1 = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcWall")
wall2 = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcWall")