Removing material from IfcMaterialList removes all occurences of the material
This commit is contained in:
Gorgious56
2021-08-26 01:06:27 +02:00
committed by GitHub
parent 0a03632e95
commit 6e3484fd46
3 changed files with 7 additions and 3 deletions
@@ -4,10 +4,11 @@ import ifcopenshell
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {"material_list": None, "material": None}
self.settings = {"material_list": None, "material_index": None}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
materials = [m for m in self.settings["material_list"].Materials if m != self.settings["material"]]
materials = list(self.settings["material_list"].Materials)
materials.pop(self.settings["material_index"])
self.settings["material_list"].Materials = materials