def test_run(self): ifc = ifcopenshell.file() subject.set(ifc) element = ifc.createIfcWall() obj = bpy.data.objects.new("Object", None) subject.link(element, obj) assert subject.get_object(element) == obj
def test_run(self): ifc = ifcopenshell.file() subject.set(ifc) obj = bpy.data.objects.new("Object", None) element = ifc.createIfcWall() obj.BIMObjectProperties.ifc_definition_id = element.id() assert subject.get_entity(obj) == element
def test_link_a_style(self): ifc = ifcopenshell.file() subject.set(ifc) element = ifc.createIfcSurfaceStyle() obj = bpy.data.materials.new("Material") subject.link(element, obj) assert subject.get_object(element) == obj
def test_link_a_material_and_style(self): ifc = ifcopenshell.file() subject.set(ifc) style = ifc.createIfcSurfaceStyle() material = ifc.createIfcMaterial() obj = bpy.data.materials.new("Material") subject.link(style, obj) subject.link(material, obj) assert subject.get_entity(obj) == material assert subject.get_object(style) == obj assert subject.get_object(material) == obj
def test_unlinking_using_an_element(self): ifc = ifcopenshell.file() subject.set(ifc) element = ifc.createIfcWall() obj = bpy.data.objects.new("Object", None) subject.link(element, obj) subject.unlink(element=element) assert subject.get_entity(obj) is None assert subject.get_object(element) is None
def test_unlink_a_material(self): ifc = ifcopenshell.file() subject.set(ifc) element = ifc.createIfcMaterial() obj = bpy.data.materials.new("Material") subject.link(element, obj) subject.unlink(element, obj) assert subject.get_entity(obj) is None assert subject.get_object(element) is None
def test_attempting_to_get_an_invalidly_linked_object(self): ifc = ifcopenshell.file() subject.set(ifc) obj = bpy.data.objects.new("Object", None) obj.BIMObjectProperties.ifc_definition_id = 1 assert subject.get_entity(obj) is None
def test_attempting_without_a_file(self): obj = bpy.data.objects.new("Object", None) obj.BIMObjectProperties.ifc_definition_id = 1 assert subject.get_entity(obj) is None
def test_attempting_to_get_an_unlinked_object(self): obj = bpy.data.objects.new("Object", None) assert subject.get_entity(obj) is None
def test_getting_the_schema_version_identifier(self): ifc = ifcopenshell.file(schema="IFC4") subject.set(ifc) assert subject.get_schema() == "IFC4"
def test_running_a_command_on_the_active_ifc_dataset(self): ifc = ifcopenshell.file() subject.set(ifc) wall = subject.run("root.create_entity", ifc_class="IfcWall") assert subject.get().by_type("IfcWall")[0] == wall
def test_getting_the_active_ifc_dataset_regardless_of_ifc_path(self): bpy.context.scene.BIMProperties.ifc_file = "test/files/basic.ifc" ifc = ifcopenshell.file() subject.set(ifc) assert subject.get() == ifc
def test_getting_an_ifc_dataset_from_a_ifc_spf_filepath(self): assert subject.get() is None bpy.context.scene.BIMProperties.ifc_file = "test/files/basic.ifc" result = subject.get() assert isinstance(result, ifcopenshell.file)
def test_setting_an_ifc_data(self): ifc = ifcopenshell.file() subject.set(ifc) assert subject.get() == ifc