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
@@ -18,11 +18,27 @@
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, element=None, attributes=None):
"""Edits the attributes of an IfcMaterial
For more information about the attributes and data types of an
IfcMaterial, consult the IFC documentation.
:param element: The IfcMaterial entity you want to edit
:type element: ifcopenshell.entity_instance.entity_instance
:param attributes: a dictionary of attribute names and values.
:type attributes: dict, optional
:return: None
:rtype: None
Example::
concrete = ifcopenshell.api.run("material.add_material", model, name="CON01", category="concrete")
ifcopenshell.api.run("material.edit_assigned_material", model,
element=concrete, attributes={"Description": "40MPA concrete with broom finish"})
"""
self.file = file
self.settings = {"element": None, "attributes": {}}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"element": element, "attributes": attributes or {}}
def execute(self):
for name, value in self.settings["attributes"].items():