material.assign_material - support batching #4474

This commit is contained in:
Andrej730
2024-04-12 11:21:35 +05:00
parent 32d2f1d629
commit 59cc9c0a16
43 changed files with 432 additions and 236 deletions
@@ -369,7 +369,7 @@ class TestRemoveProduct(test.bootstrap.IFC4):
def test_removing_all_material_relationships_of_an_element(self):
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
material = ifcopenshell.api.run("material.add_material", self.file, name="Foo")
ifcopenshell.api.run("material.assign_material", self.file, product=element, material=material)
ifcopenshell.api.run("material.assign_material", self.file, products=[element], material=material)
ifcopenshell.api.run("root.remove_product", self.file, product=element)
assert not self.file.by_type("IfcRelAssociatesMaterial")
assert self.file.by_type("IfcMaterial")