Example #1
0
 def test_doing_nothing_if_the_object_has_no_collection(self):
     bpy.ops.bim.create_project()
     wall_obj = bpy.data.objects.new("Object", None)
     wall_element = tool.Ifc.get().createIfcWall()
     tool.Ifc.link(wall_element, wall_obj)
     subject.sync(wall_obj)
     assert not wall_obj.users_collection
Example #2
0
 def test_in_decomposition_mode_elements_can_be_in_spatial_containers(self):
     bpy.ops.bim.create_project()
     wall_obj = bpy.data.objects.new("Object", None)
     wall_element = tool.Ifc.get().createIfcWall()
     tool.Ifc.link(wall_element, wall_obj)
     bpy.data.collections.get("IfcSite/My Site").objects.link(wall_obj)
     subject.sync(wall_obj)
     assert ifcopenshell.util.element.get_container(wall_element).is_a(
         "IfcSite")
Example #3
0
 def test_in_decomposition_mode_elements_can_aggregate(self):
     bpy.ops.bim.create_project()
     obj = bpy.data.objects.new("IfcBuildingStorey/Name", None)
     col = bpy.data.collections.new("IfcBuildingStorey/Name")
     element = tool.Ifc.get().createIfcBuildingStorey(Name="Name")
     tool.Ifc.link(element, obj)
     bpy.data.collections.get("IfcBuilding/My Building").children.link(col)
     col.objects.link(obj)
     subject.sync(obj)
     assert ifcopenshell.util.element.get_aggregate(element).is_a(
         "IfcBuilding")