ReferenceArrayDatapinElement#

class ReferenceArrayDatapinElement(parent_client: ansys.api.modelcenter.v0.grpc_modelcenter_workflow_pb2_grpc.ModelCenterWorkflowServiceStub, parent_element_id: ansys.api.modelcenter.v0.element_messages_pb2.ElementId, index: int, parent_engine: ansys.modelcenter.workflow.grpc_modelcenter.engine.Engine)#

Bases: ansys.modelcenter.workflow.api.IDatapinReferenceBase

Represents a single element in an reference array datapin.

Note

This class should not be directly instantiated by clients. Get a Workflow object from an instantiated Engine instance and use it to get a valid ReferenceArrayDatapin instance, which can then be indexed to get an object of this type.

Overview#

get_state

Get the state of the reference equation.

set_state

Set the state of the referenced datapin.

equation

Reference equation describing the values that the datapin

is_direct

Flag indicating if the datapin is a direct reference.

Import detail#

from ansys.modelcenter.workflow.grpc_modelcenter.reference_datapin import ReferenceArrayDatapinElement

Property detail#

property ReferenceArrayDatapinElement.equation: str#

Reference equation describing the values that the datapin references.

Returns:
str

Reference equation.

property ReferenceArrayDatapinElement.is_direct: bool#

Flag indicating if the datapin is a direct reference.

Direct reference datapins refer to one specific datapin only. Their equations are just the name of one other datapin. Only direct-reference datapins that refer to a datapin that can be set directly can use the set_state() method to set the referenced datapin.

Returns:
bool

True if the datapin is a direct reference, False otherwise.

Method detail#

ReferenceArrayDatapinElement.get_state(hid: str | None = None) ansys.tools.variableinterop.VariableState#

Get the state of the reference equation.

ReferenceArrayDatapinElement.set_state(state: ansys.tools.variableinterop.VariableState) None#

Set the state of the referenced datapin.

This method works only if this is a direct reference. Specifically, it applies if the equation is just the name of a single other datapin with no modification. If it is not a direct reference, a ValueError is raised. A ValueError is also raised if the referenced datapin is not allowed to be set directly in the first place. For example, if it is an output or linked input.