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]
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
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")
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
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
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]
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"
def test_run(self): TestImportSystemAttributes().test_importing_a_system() assert subject.export_system_attributes() == { "GlobalId": "GlobalId", "Name": "Name", "Description": "Description", "ObjectType": "ObjectType", }
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
def test_run(self): subject.enable_system_editing_ui() assert bpy.context.scene.BIMSystemProperties.is_editing is True
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
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()