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
@@ -17,24 +17,21 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
class Usecase:
def __init__(self, file, structural_analysis_model=None, attributes=None):
"""Edits the attributes of an IfcStructuralAnalysisModel
def edit_structural_analysis_model(file, structural_analysis_model=None, attributes=None) -> None:
"""Edits the attributes of an IfcStructuralAnalysisModel
For more information about the attributes and data types of an
IfcStructuralAnalysisModel, consult the IFC documentation.
For more information about the attributes and data types of an
IfcStructuralAnalysisModel, consult the IFC documentation.
:param structural_analysis_model: The IfcStructuralAnalysisModel entity you want to edit
:type structural_analysis_model: ifcopenshell.entity_instance
:param attributes: a dictionary of attribute names and values.
:type attributes: dict, optional
:return: None
:rtype: None
"""
self.file = file
self.settings = {"structural_analysis_model": structural_analysis_model, "attributes": attributes or {}}
:param structural_analysis_model: The IfcStructuralAnalysisModel entity you want to edit
:type structural_analysis_model: ifcopenshell.entity_instance
:param attributes: a dictionary of attribute names and values.
:type attributes: dict, optional
:return: None
:rtype: None
"""
settings = {"structural_analysis_model": structural_analysis_model, "attributes": attributes or {}}
def execute(self):
for name, value in self.settings["attributes"].items():
setattr(self.settings["structural_analysis_model"], name, value)
return self.settings["structural_analysis_model"]
for name, value in settings["attributes"].items():
setattr(settings["structural_analysis_model"], name, value)
return settings["structural_analysis_model"]