mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user