mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
material.remove_material_set to remove usages
To prevent them from being invalidated. Noticed this as a possible issue investigating https://community.osarch.org/discussion/2820/error-message-in-bonsai-bim
This commit is contained in:
@@ -31,6 +31,9 @@ def unassign_material(file: ifcopenshell.file, products: list[ifcopenshell.entit
|
||||
|
||||
If the product does not have a material, nothing happens.
|
||||
|
||||
Unassigning a LayerSet or ProfileSet from the product type will also
|
||||
remove all Usages of the set.
|
||||
|
||||
:param products: The list IfcProducts that may or may not have a material
|
||||
:return: None
|
||||
|
||||
@@ -76,6 +79,8 @@ class Usecase:
|
||||
continue
|
||||
if material.is_a() in ["IfcMaterialLayerSet", "IfcMaterialProfileSet"]:
|
||||
# Remove set usages
|
||||
# TODO: be more considerate and remove only usages
|
||||
# associated with the set + product type, not all usages?
|
||||
for inverse in self.file.get_inverse(material):
|
||||
if self.file.schema == "IFC2X3":
|
||||
if not inverse.is_a("IfcMaterialLayerSetUsage"):
|
||||
|
||||
Reference in New Issue
Block a user