Write documentation for structural API module

This commit is contained in:
Dion Moult
2023-01-03 17:32:08 +11:00
parent e53a9cd66c
commit 0c77fb81ce
21 changed files with 342 additions and 101 deletions
@@ -20,14 +20,32 @@ import ifcopenshell.api
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, name=None, ifc_class="IfcStructuralLoadLinearForce"):
"""Adds a new structural load
Structural loads may be actions or reactions. A simple load might be a
static and be linear, planar, or a single point. Alternatively, loads
may be defined as a configuration of multiple loads.
:param name: The name of the load
:type name: str,optional
:param ifc_class: The subtype of IfcStructuralLoad to create. Consult
the IFC documentation to see all the types of loads.
:type ifc_class: str
:return: The newly created load entity, depending on the ifc_class
specified.
:rtype: ifcopenshell.entity_instance.entity_instance
Example::
# Create a simple linear load
ifcopenshell.api.run("structural.add_structural_load", model)
"""
self.file = file
self.settings = {
"name": None,
"ifc_class": "IfcStructuralLoadLinearForce",
"name": name,
"ifc_class": ifc_class,
}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
return self.file.create_entity(self.settings["ifc_class"], Name=self.settings["name"])