mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
material.unassign_material - support batching #4474
This commit is contained in:
@@ -155,10 +155,9 @@ class Usecase:
|
||||
return
|
||||
|
||||
# NOTE: we always reassign material, even if it might be assigned before
|
||||
for product in self.products:
|
||||
material = ifcopenshell.util.element.get_material(product)
|
||||
if material:
|
||||
ifcopenshell.api.run("material.unassign_material", self.file, product=product)
|
||||
products_to_unassign_material = [p for p in self.products if ifcopenshell.util.element.get_material(p)]
|
||||
if products_to_unassign_material:
|
||||
ifcopenshell.api.run("material.unassign_material", self.file, products=products_to_unassign_material)
|
||||
|
||||
if self.settings["type"] == "IfcMaterial" or (
|
||||
self.settings["material"] and not self.settings["material"].is_a("IfcMaterial")
|
||||
|
||||
Reference in New Issue
Block a user