diff --git a/src/ifcopenshell-python/ifcopenshell/api/geometry/connect_path.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/connect_path.py index 3135bef116..64c9fddb62 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/geometry/connect_path.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/connect_path.py @@ -31,6 +31,7 @@ def connect_path( relating_connection: str = "NOTDEFINED", related_connection: str = "NOTDEFINED", description: Optional[str] = None, + connection_geometry: Optional[ifcopenshell.entity_instance] = None, ) -> ifcopenshell.entity_instance: incompatible_connections: list[ifcopenshell.entity_instance] = [] for rel in relating_element.ConnectedTo: @@ -73,6 +74,7 @@ def connect_path( ifcopenshell.guid.new(), OwnerHistory=ifcopenshell.api.owner.create_owner_history(file), Description=description, + ConnectionGeometry=connection_geometry, RelatingElement=relating_element, RelatedElement=related_element, RelatingConnectionType=relating_connection, diff --git a/src/ifcopenshell-python/test/api/geometry/test_connect_path.py b/src/ifcopenshell-python/test/api/geometry/test_connect_path.py index bda341d2c6..0927e474ae 100644 --- a/src/ifcopenshell-python/test/api/geometry/test_connect_path.py +++ b/src/ifcopenshell-python/test/api/geometry/test_connect_path.py @@ -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")