Generate functions for all API usecases for better static code features. See #2693.

This commit is contained in:
Dion Moult
2024-05-06 14:35:39 +10:00
parent 10f894e2ea
commit d11ec67129
330 changed files with 13283 additions and 13751 deletions
@@ -20,30 +20,27 @@ import ifcopenshell
import ifcopenshell.api
class Usecase:
def __init__(self, file):
"""Add a new structural analysis model
def add_structural_analysis_model(file) -> None:
"""Add a new structural analysis model
A structural analysis model is a group of all the loads, reactions,
structural members, and structural connections required to describe a
structural analysis model.
A structural analysis model is a group of all the loads, reactions,
structural members, and structural connections required to describe a
structural analysis model.
A 3D analytical model is assumed.
A 3D analytical model is assumed.
:return: The newly created IfcStructuralAnalysisModel
:rtype: ifcopenshell.entity_instance
:return: The newly created IfcStructuralAnalysisModel
:rtype: ifcopenshell.entity_instance
Example:
Example:
.. code:: python
.. code:: python
# Create a fresh blank structural analysis
analysis = ifcopenshell.api.run("structural.add_structural_analysis_model", model)
"""
self.file = file
self.settings = {}
# Create a fresh blank structural analysis
analysis = ifcopenshell.api.run("structural.add_structural_analysis_model", model)
"""
settings = {}
def execute(self):
return ifcopenshell.api.run(
"root.create_entity", self.file, ifc_class="IfcStructuralAnalysisModel", predefined_type="LOADING_3D"
)
return ifcopenshell.api.run(
"root.create_entity", file, ifc_class="IfcStructuralAnalysisModel", predefined_type="LOADING_3D"
)