ifcopenshell.api.material.remove_material#

Module Contents#

class ifcopenshell.api.material.remove_material.Usecase(file, material=None)#

Removes a material

If the material is used in a material set, the corresponding layer, profile, or constituent is also removed. Note that this may result in a material set with zero items in it, which is invalid, so the user must take care of this situation themselves.

Parameters

material (ifcopenshell.entity_instance.entity_instance) – The IfcMaterial entity you want to remove

Returns

None

Return type

None

Example:

# Create a material
aluminium = ifcopenshell.api.run("material.add_material", model, name="AL01", category="aluminium")

# ... and remove it
ifcopenshell.api.run("material.remove_material", model, material=aluminium)
execute(self)#