Add API documentation for the material module

This commit is contained in:
Dion Moult
2022-12-07 17:30:08 +11:00
parent 7da3d9ee70
commit cf87852d9c
23 changed files with 1129 additions and 90 deletions
@@ -20,11 +20,29 @@ import ifcopenshell
class Usecase:
def __init__(self, file, **settings):
def __init__(self, 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.
:param material: The IfcMaterial entity you want to remove
:type material: ifcopenshell.entity_instance.entity_instance
:return: None
:rtype: 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)
"""
self.file = file
self.settings = {"material": None}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"material": material}
def execute(self):
inverse_elements = self.file.get_inverse(self.settings["material"])