Write documentation for pset_template API module

This commit is contained in:
Dion Moult
2022-12-16 11:22:46 +11:00
parent 0ccea3cef8
commit d2fee728f2
9 changed files with 270 additions and 57 deletions
@@ -18,11 +18,30 @@
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, pset_template=None, attributes=None):
"""Edits the attributes of an IfcPropertySetTemplate
For more information about the attributes and data types of an
IfcPropertySetTemplate, consult the IFC documentation.
:param pset_template: The IfcPropertySetTemplate entity you want to edit
:type pset_template: ifcopenshell.entity_instance.entity_instance
:param attributes: a dictionary of attribute names and values.
:type attributes: dict, optional
:return: None
:rtype: None
Example::
# Whoops! We named it with a buildingSMART reserved "Pset_" prefix!
template = ifcopenshell.api.run("pset_template.add_pset_template", model, name="Pset_RiskFactors")
# Let's fix it to prefix with our company code instead.
ifcopenshell.api.run("pset_template.edit_pset_template", model,
pset_template=template, attributes={"Name": "ABC_RiskFactors"})
"""
self.file = file
self.settings = {"pset_template": None, "attributes": {}}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"pset_template": pset_template, "attributes": attributes or {}}
def execute(self):
for name, value in self.settings["attributes"].items():