mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Generate functions for all API usecases for better static code features. See #2693.
This commit is contained in:
+15
-18
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user