Write docs for system API module

This commit is contained in:
Dion Moult
2023-01-04 16:09:26 +11:00
parent b86818ead3
commit 92623b98e2
10 changed files with 322 additions and 47 deletions
@@ -18,11 +18,30 @@
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, system=None, attributes=None):
"""Edits the attributes of an IfcSystem
For more information about the attributes and data types of an
IfcSystem, consult the IFC documentation.
:param system: The IfcSystem entity you want to edit
:type system: ifcopenshell.entity_instance.entity_instance
:param attributes: a dictionary of attribute names and values.
:type attributes: dict, optional
:return: None
:rtype: None
Example::
# A completely empty distribution system
system = ifcopenshell.api.run("system.add_system", model)
# Change the name of the system to "HW" for Hot Water
ifcopenshell.api.run("system.edit_system", model, system=system, attributes={"Name": "HW"})
"""
self.file = file
self.settings = {"system": None, "attributes": {}}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"system": system, "attributes": attributes or {}}
def execute(self):
for name, value in self.settings["attributes"].items():