OperatorContext.GetInputValue

Introduced

v5.1

Description

Returns the value of a given input port on the CustomOperator. If the connected object is a Parameter this will return the actual value of the Parameter value, not the Parameter object. Otherwise it will return the object that represents the input object, and this object can be used to retrieve information about the state of the input object. For example if the operator is connected to a Parameter of type double this will return a double. And if the operator is connected to a Primitive this will return a Primitive.

Note: This method is a convenient and fast approach that hides the existence of InputPorts.

C# Syntax

Object OperatorContext.GetInputValue( Object in_vPortIndexOrName, Object in_vPortGroupIndexOrName, Int32 in_lPortGroupInstance );

Scripting Syntax

OperatorContext.GetInputValue( PortIndexOrName, [PortGroupIndex], [PortGroupInstance] );

Parameters

Parameter Type Description
PortIndexOrName Long index of the input or String name. It is faster to retrieve an input port by its index rather than its name. If the operator was created by the AddCustomOp command or Parameter.AddCustomOp method then the index is easy to determine based on the order of the inputs in the input argument. If the operator was built manually then the index can be determined based on the order of calls to CustomOperator.AddInputPort or CustomOperator.AddIOPort.
PortGroupIndex Long index of the PortGroup or String name. Use this parameter for advanced operators that have more than one PortGroup. Otherwise it is assumed that the input is on the first group (Group 0).

Tip: It is faster to reference a PortGroup by its index rather than its name.

Default Value: 0

PortGroupInstance Long Use this parameter for advanced operators that support having more than one object connecting to a particular PortGroup. Otherwise it is assumed that the input is on the first group instance.

Default Value: 0

See Also

Operator.GetInputValue