Add docs to layer API

This commit is contained in:
Dion Moult
2022-12-07 08:59:24 +11:00
parent 45953c6b49
commit 9650bbb5ee
8 changed files with 149 additions and 28 deletions
@@ -18,11 +18,27 @@
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, layer=None, attributes=None):
"""Edits the attributes of an IfcPresentationLayerAssignment
For more information about the attributes and data types of an
IfcPresentationLayerAssignment, consult the IFC documentation.
:param layer: The IfcPresentationLayerAssignment entity you want to edit
:type layer: ifcopenshell.entity_instance.entity_instance
:param attributes: a dictionary of attribute names and values.
:type attributes: dict, optional
:return: None
:rtype: None
Example::
layer = ifcopenshell.api.run("layer.add_layer", model, Name="AI-WALL")
ifcopenshell.api.run("layer.edit_layer", model,
layer=layer, attributes={"Description": "All walls, based on the AIA standard."})
"""
self.file = file
self.settings = {"layer": None, "attributes": {}}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"layer": layer, "attributes": attributes or {}}
def execute(self):
for name, value in self.settings["attributes"].items():