mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Write documentation for structural API module
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user