mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 10:57:49 +00:00
Write documentation for pset_template API module
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user