Add docs for library API module

This commit is contained in:
Dion Moult
2022-12-07 12:20:29 +11:00
parent 9650bbb5ee
commit 7da3d9ee70
8 changed files with 213 additions and 35 deletions
@@ -18,11 +18,28 @@
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, library=None, attributes=None):
"""Edits the attributes of an IfcLibraryInformation
For more information about the attributes and data types of an
IfcLibraryInformation, consult the IFC documentation.
:param library: The IfcLibraryInformation entity you want to edit
:type library: ifcopenshell.entity_instance.entity_instance
:param attributes: a dictionary of attribute names and values.
:type attributes: dict, optional
:return: None
:rtype: None
Example::
library = ifcopenshell.api.run("library.add_library", model, name="Brickschema")
ifcopenshell.api.run("library.edit_library", model, library=library,
attributes={"Description": "A Brickschema TTL including only mechanical distribution systems."})
"""
self.file = file
self.settings = {"library": None, "attributes": {}}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"library": library, "attributes": attributes or {}}
def execute(self):
for name, value in self.settings["attributes"].items():