You can now connect, disconnect, and set flow directions of distribution ports in Blender.

This commit is contained in:
Dion Moult
2022-02-03 12:04:20 +11:00
parent d333cb1b78
commit 94ff8349d3
11 changed files with 145 additions and 2 deletions
@@ -61,3 +61,12 @@ class TestGetPortsIFC2X3(test.bootstrap.IFC2X3):
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcFlowSegment")
ifcopenshell.api.run("system.assign_port", self.file, element=element, port=port)
assert subject.get_ports(element) == [port]
class TestGetConnectedPort(test.bootstrap.IFC4):
def test_run(self):
port1 = ifcopenshell.api.run("system.add_port", self.file)
port2 = ifcopenshell.api.run("system.add_port", self.file)
ifcopenshell.api.run("system.connect_port", self.file, port1=port1, port2=port2)
assert subject.get_connected_port(port1) == port2
assert subject.get_connected_port(port2) == port1