SetState()

Sets the state of a specified data model container (can be either a singleton or an object).

Returns a Boolean value of True if the state was updated. Otherwise, returns a value of False. The latter would happen if a value were set that is no different from the value already in the state.

By default, System Coupling allows settings to be made that are not currently available in the data model, as long as they are settings that are potentially available. They will not show up in the data model if they are not currently available, but if the state is later adjusted such that the settings become available, the values that were previously set will be seen.

This behavior can be controlled by the optional VerifyCommittedState argument. This causes a check to be performed for submission of unavailable settings, and an exception is raised if the check fails. Note that, despite the exception, the settings will remain committed.

Essential Keyword Arguments

ObjectPath : string

String indicating the path of the container to have its state set.

State : dictionary

Dictionary with the container state (settings) as keys and intended values as values.

Optional Keyword Arguments

VerifyCommittedState : boolean

Boolean that controls whether to check if only settings that are currently available have been submitted. If the check is performed and it fails, an exception will be raised.

Return Type

Boolean

Examples

Example 59: Set the state on a singleton


SetState(ObjectPath = '/SystemCoupling/SolutionControl', State = {'DurationOption': 
'EndTime', 'EndTime': '0.5 [s]'})

True


Example 60: Set the state on an object


SetState(ObjectPath = '/SystemCoupling/CouplingParticipant:MAPDL-1/
Variable:FORC', State = {'QuantityType': 'Force', 'DisplayName': 'TestForce'})

True