예제 #1
0
 def test_getting_an_inherited_material_from_the_elements_type(self):
     element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
     element_type = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWallType")
     ifcopenshell.api.run("type.assign_type", self.file, related_object=element, relating_type=element_type)
     material = ifcopenshell.api.run("material.add_material", self.file)
     ifcopenshell.api.run("material.assign_material", self.file, product=element_type, material=material)
     assert subject.get_material(element) == material
예제 #2
0
 def test_getting_a_material_list_of_a_product(self):
     element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
     material = ifcopenshell.api.run("material.add_material", self.file)
     rel = ifcopenshell.api.run(
         "material.assign_material", self.file, product=element, type="IfcMaterialList", material=material
     )
     assert subject.get_material(element) == rel.RelatingMaterial
예제 #3
0
 def test_getting_a_material_profile_set_indirectly_from_an_assigned_usage(self):
     element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
     rel = ifcopenshell.api.run(
         "material.assign_material", self.file, product=element, type="IfcMaterialProfileSetUsage"
     )
     assert subject.get_material(element, should_skip_usage=True) == rel.RelatingMaterial.ForProfileSet
예제 #4
0
 def test_getting_a_material_profile_set_usage_of_a_product(self):
     element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
     rel = ifcopenshell.api.run(
         "material.assign_material", self.file, product=element, type="IfcMaterialProfileSetUsage"
     )
     assert subject.get_material(element) == rel.RelatingMaterial
예제 #5
0
 def test_getting_the_material_of_a_product(self):
     element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
     material = ifcopenshell.api.run("material.add_material", self.file)
     ifcopenshell.api.run("material.assign_material", self.file, product=element, material=material)
     assert subject.get_material(element) == material