mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Removing material from IfcMaterialList removes all occurences of the material
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user