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,29 @@
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, reference=None, attributes=None):
"""Edits the attributes of an IfcLibraryReference
For more information about the attributes and data types of an
IfcLibraryReference, consult the IFC documentation.
:param reference: The IfcLibraryReference entity you want to edit
:type reference: 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")
# Let's create a reference to a single AHU in our Brickschema dataset
reference = ifcopenshell.api.run("library.add_reference", model, library=library)
ifcopenshell.api.run("library.edit_reference", model,
reference=reference, attributes={"Identification": "http://example.org/digitaltwin#AHU01"})
"""
self.file = file
self.settings = {"reference": None, "attributes": {}}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"reference": reference, "attributes": attributes or {}}
def execute(self):
for name, value in self.settings["attributes"].items():