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,23 +20,36 @@ import ifcopenshell.api
class Usecase:
def __init__(self, file, **settings):
def __init__(
self, file, name="Unnamed", action_type="NOTDEFINED", action_source="NOTDEFINED"
):
"""Adds a new load case, which is a collection of related load groups
:param name: The name of the load case
:type name: str
:param action_type: Choose from EXTRAORDINARY_A, PERMANENT_G,
or VARIABLE_Q, taken from the Eurocode standard.
:type action_type: str
:param action_source: The source of the load case, such as DEAD_LOAD_G,
LIVE_LOAD_Q, TRANSPORT, ICE, etc. For the full list consult
IfcActionSourceTypeEnum in the IFC documentation.
:type action_source: str
:return: The new IfcStructuralLoadCase
:rtype: ifcopenshell.entity_instance.entity_instance
"""
self.file = file
self.settings = {
"name": "Unnamed",
"predefined_type": "LOAD_CASE",
"action_type": "NOTDEFINED",
"action_source": "NOTDEFINED",
"name": name,
"action_type": action_type,
"action_source": action_source,
}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
load_case = ifcopenshell.api.run(
"root.create_entity",
self.file,
ifc_class="IfcStructuralLoadCase",
predefined_type=self.settings["predefined_type"],
predefined_type="LOAD_CASE",
name=self.settings["name"],
)
load_case.ActionType = self.settings["action_type"]