示例#1
0
 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
示例#2
0
 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
示例#3
0
 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
示例#4
0
 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
示例#5
0
 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
示例#6
0
 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
示例#7
0
 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
示例#8
0
 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
示例#9
0
 def test_attempting_to_get_an_unlinked_object(self):
     obj = bpy.data.objects.new("Object", None)
     assert subject.get_entity(obj) is None
示例#10
0
 def test_getting_the_schema_version_identifier(self):
     ifc = ifcopenshell.file(schema="IFC4")
     subject.set(ifc)
     assert subject.get_schema() == "IFC4"
示例#11
0
 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
示例#12
0
 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
示例#13
0
 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)
示例#14
0
 def test_setting_an_ifc_data(self):
     ifc = ifcopenshell.file()
     subject.set(ifc)
     assert subject.get() == ifc