mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
material.unassign_material - support batching #4474
This commit is contained in:
@@ -174,3 +174,15 @@ class TestTemporarySupportForDeprecatedAPIArguments(test.bootstrap.IFC4):
|
||||
)
|
||||
assert len(self.file.by_type("IfcRelAssociatesMaterial")) == 1
|
||||
assert element.HasAssociations[0].RelatingMaterial == material
|
||||
|
||||
@deprecation_check
|
||||
def test_unassign_single_material(self):
|
||||
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||
material = ifcopenshell.api.run("material.add_material", self.file, name="CON01")
|
||||
ifcopenshell.api.run(
|
||||
"material.assign_material", self.file, products=[element], type="IfcMaterial", material=material
|
||||
)
|
||||
ifcopenshell.api.run("material.unassign_material", self.file, product=element)
|
||||
assert len(self.file.by_type("IfcRelAssociatesMaterial")) == 0
|
||||
assert len(self.file.by_type("IfcWall")) == 1
|
||||
assert len(self.file.by_type("IfcMaterial")) == 1
|
||||
|
||||
Reference in New Issue
Block a user