Example #1
0
 def test_run(self):
     ifc = ifcopenshell.file()
     tool.Ifc().set(ifc)
     element = ifc.createIfcDuctSegment()
     port = ifc.createIfcDistributionPort()
     ifcopenshell.api.run("system.assign_port", ifc, element=element, port=port)
     subject.get_ports(element) == [port]
Example #2
0
 def test_run(self):
     ifc = ifcopenshell.file()
     port1 = ifcopenshell.api.run("system.add_port", ifc)
     port2 = ifcopenshell.api.run("system.add_port", ifc)
     ifcopenshell.api.run("system.connect_port", ifc, port1=port1, port2=port2)
     assert subject.get_connected_port(port1) == port2
     assert subject.get_connected_port(port2) == port1
Example #3
0
 def test_run(self):
     ifc = ifcopenshell.file()
     tool.Ifc().set(ifc)
     obj = bpy.data.objects.new("Object", None)
     element = ifc.createIfcWall()
     tool.Ifc.link(element, obj)
     subject.delete_element_objects([element])
     assert not bpy.data.objects.get("Object")
Example #4
0
 def test_run(self):
     ifc = ifcopenshell.file()
     tool.Ifc().set(ifc)
     element = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcPump")
     obj = bpy.data.objects.new("Object", None)
     bpy.context.scene.collection.objects.link(obj)
     tool.Ifc.link(element, obj)
     subject.select_elements([element])
     assert obj in bpy.context.selected_objects
Example #5
0
 def test_run(self):
     ifc = ifcopenshell.file()
     tool.Ifc().set(ifc)
     element = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcPump")
     system = ifcopenshell.api.run("system.add_system", ifc, ifc_class="IfcSystem")
     ifcopenshell.api.run("system.assign_system", ifc, product=element, system=system)
     obj = bpy.data.objects.new("Object", None)
     bpy.context.scene.collection.objects.link(obj)
     tool.Ifc.link(element, obj)
     subject.select_system_products(system)
     assert obj in bpy.context.selected_objects
Example #6
0
 def test_run(self):
     ifc = ifcopenshell.api.run("project.create_file")
     ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcProject")
     ifcopenshell.api.run("unit.assign_unit", ifc)
     tool.Ifc().set(ifc)
     port = ifc.createIfcDistributionPort()
     subject.load_ports([port])
     obj = tool.Ifc.get_object(port)
     assert obj
     assert obj.users_collection
     assert list(obj.location) == [0, 0, 0]
Example #7
0
 def test_run(self):
     ifc = ifcopenshell.file()
     tool.Ifc().set(ifc)
     system = ifc.createIfcDistributionSystem()
     zone = ifc.createIfcZone()
     subject.import_systems()
     props = bpy.context.scene.BIMSystemProperties
     assert len(props.systems) == 1
     assert props.systems[0].ifc_definition_id == system.id()
     assert props.systems[0].name == "Unnamed"
     assert props.systems[0].ifc_class == "IfcDistributionSystem"
Example #8
0
 def test_run(self):
     TestImportSystemAttributes().test_importing_a_system()
     assert subject.export_system_attributes() == {
         "GlobalId": "GlobalId",
         "Name": "Name",
         "Description": "Description",
         "ObjectType": "ObjectType",
     }
Example #9
0
 def test_run(self):
     ifc = ifcopenshell.file()
     tool.Ifc().set(ifc)
     obj = bpy.data.objects.new("Object", None)
     element = ifc.createIfcWall()
     tool.Ifc.link(element, obj)
     obj = subject.create_empty_at_cursor_with_element_orientation(element)
     assert obj.matrix_world == bpy.context.scene.cursor.matrix
Example #10
0
 def test_run(self):
     subject.enable_system_editing_ui()
     assert bpy.context.scene.BIMSystemProperties.is_editing is True
Example #11
0
 def test_run(self):
     bpy.context.scene.BIMSystemProperties.active_system_id = 10
     subject.disable_editing_system()
     assert bpy.context.scene.BIMSystemProperties.active_system_id == 0
Example #12
0
 def test_run(self):
     ifc = ifcopenshell.file()
     tool.Ifc().set(ifc)
     system = ifcopenshell.api.run("system.add_system", ifc, ifc_class="IfcSystem")
     subject.set_active_system(system)
     assert bpy.context.scene.BIMSystemProperties.active_system_id == system.id()