mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
purge unused material to try to purge materials recursively #3914
As on first iteration it may remove only unused material sets and on the next iteration it will be able to remove IfcMaterials that were not used anywhere else besides those material sets.
This commit is contained in:
@@ -413,4 +413,9 @@ class Material(bonsai.core.tool.Material):
|
||||
continue
|
||||
ifcopenshell.api.material.remove_material(ifc_file, material)
|
||||
i += 1
|
||||
|
||||
if i == 0:
|
||||
return 0
|
||||
|
||||
i += cls.purge_unused_materials()
|
||||
return i
|
||||
|
||||
Reference in New Issue
Block a user