UI for assigning controls to flow elements #3981

Example - https://imgur.com/a/CZQIoHp
This commit is contained in:
Andrej730
2023-11-09 17:16:32 +05:00
parent 72b3f1e967
commit fd69d91776
7 changed files with 214 additions and 0 deletions
+27
View File
@@ -277,3 +277,30 @@ class TestSetActiveSystem(NewFile):
system = ifcopenshell.api.run("system.add_system", ifc, ifc_class="IfcSystem")
subject.set_active_edited_system(system)
assert bpy.context.scene.BIMSystemProperties.edited_system_id == system.id()
class TestFlowElementAndControls(NewFile):
def test_run(self):
ifc = ifcopenshell.file()
flow_element = ifc.createIfcFlowSegment()
flow_control = ifc.createIfcController()
flow_control1 = ifc.createIfcController()
assert len(subject.get_flow_element_controls(flow_element)) == 0
assert subject.get_flow_control_flow_element(flow_control) == None
ifcopenshell.api.run(
"system.assign_flow_control",
ifc,
related_flow_control=flow_control,
relating_flow_element=flow_element,
)
ifcopenshell.api.run(
"system.assign_flow_control",
ifc,
related_flow_control=flow_control1,
relating_flow_element=flow_element,
)
controls = subject.get_flow_element_controls(flow_element)
assert set(controls) == set((flow_control, flow_control1))
assert subject.get_flow_control_flow_element(flow_control) == flow_element