Temporary Settings and Python
The Temporary Settings capabilities are enabled by Python. Thus, the Temporary Settings file only supports those properties which are supported by the Adams Python interface. So, the property browser interface shows only those properties.
Furthermore, the Python interface for Temporary Settings is not part of
adamspy, in the sense that it does not make use of any of the adamspy class hierarchy and also does not provide a python interface for a database object.
The TemporarySettings class and its methods are therefore documented below:
TemporarySettings
This class provides a Python interface for temporary settings.
Detailed Description
Description:
The TemporarySettings class allows users to specify sets of model parameter data that can be applied "temporarily" for a given simulation.
Methods:
apply (model, file_names)
This method applies the settings in the files specified in "file_names" on the given model.
Example:
Adams.TemporarySettings.apply("MODEL_1", "C:/work/settings1.tsf", "C:/work/settings2.tsf")
revert()
This method reverts the settings applied by the apply() method.
Example:
Adams.TemporarySettings.revert()
write (file_name)
This method writes out the settings in the file indicated by "file_name"
To write or export a TSF file, the following properties need to be set:
■object_properties
■object_values
■solver_properties
■solver_values
Notes: | ■The number of object properties should be equal to the number of object values. ■The number of solver properties should be equal to the number of solver values. |
Example:
Adams.TemporarySettings.object_properties = ["dv_1.value","joint_1.i_marker_name"]
Adams.TemporarySettings.object_values = ["45.0",".MODEL_1.PART_2.MARKER_2"]
Adams.TemporarySettings.solver_properties = ["CORRECTOR","save_files"]
Adams.TemporarySettings.solver_values = ["modified","YES"]
Adams.TemporarySettings.write("C:/work/test.tsf")