ReferenceArrayDatapin#

class ReferenceArrayDatapin(element_id: ansys.api.modelcenter.v0.element_messages_pb2.ElementId, engine: ansys.modelcenter.workflow.grpc_modelcenter.engine.Engine)#

Bases: ReferenceDatapinBase, ansys.modelcenter.workflow.api.IReferenceArrayDatapin

Represents a 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 instance of this object.

Overview#

__getitem__

Implementation of __getitem__ for ReferenceArrayDatapins.

set_length

Resize the array.

set_state

Set the state of the datapin.

get_reference_properties

Get the reference properties on the reference datapin.

__eq__

Return self==value.

__len__

Get the length of the reference array.

Import detail#

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

Method detail#

ReferenceArrayDatapin.__eq__(other)#

Return self==value.

abstract ReferenceArrayDatapin.__getitem__(index: int) ansys.modelcenter.workflow.api.IDatapinReferenceBase#
abstract ReferenceArrayDatapin.__getitem__(index: slice) Sequence[ansys.modelcenter.workflow.api.IDatapinReferenceBase]

Implementation of __getitem__ for ReferenceArrayDatapins.

Parameters:
index: int | slice

Index in the reference array datapin or a slice of the reference array datapin to return.

Returns:
ReferenceArrayDatapinElement at the given index or a slice
of the reference array datapin.
ReferenceArrayDatapin.__len__() int#

Get the length of the reference array.

Returns:
Length of the reference array.
ReferenceArrayDatapin.set_length(new_size: int) None#

Resize the array.

If smaller than the current size, elements at the end of the array are dropped. If larger than the current size, new empty elements are added to the end of the array.

Parameters:
new_sizeint

New size of the array.

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

Set the state of the datapin.

ReferenceArrayDatapin.get_reference_properties() Mapping[str, ansys.modelcenter.workflow.api.IReferenceArrayProperty]#

Get the reference properties on the reference datapin.

Returns:
Mapping[str, IReferencePropertyBase]

Mapping of names to reference properties.