## Operator.Connect

### Introduced

v4.0

### Description

Connects an operator to the specified objects.

### C# Syntax

    Operator.Connect( Object in_connections, siConstructionMode in_constructionmode );

### Scripting Syntax

    Operator.Connect( [Connections], [ConstructionMode] );

### Parameters

Parameter | Type | Description
--- | --- | ---
Connections | Variant | Contains connection specification of objects to connect.
ConstructionMode | siConstructionMode | The location in the construction stack where the operator should be created. This only applies to output connections made to Geometry objects; this mode will be ignored for all other types of connections. Default Value: siConstructionModeDefault

### Examples

#### 1. JScript Example

    /*
            This example demonstrates how to create and instantiate a runtime
            custom operator and connect it to a cube.
    */
    NewScene( null, false );
    var obj = CreatePrim( "Cube", "MeshSurface");
    function MyOperator_Update( ctx, out, in1 )
    {
            Application.LogMessage( "MyOperator_Update: " + out.Name );
            var apos = in1.Value.Geometry.Points.PositionArray.toArray();
            out.Value.Geometry.Points.PositionArray = apos;
    }
    var sop = XSIFactory.CreateScriptedOp( "MyOperator", "", "JScript" )
    sop.AddOutputPort( obj.ActivePrimitive );
    sop.AddInputPort( "cube.polymsh" );
    sop.Code = MyOperator_Update.toString()
    sop.Connect();

#### 2. JScript Example

    /*
            This example demonstrates how to instantiate the built-in Twist operator
            and connect it to a cube.
    */
    NewScene( null, false );
    var obj = CreatePrim( "Cube", "MeshSurface");
    var op = XSIFactory.CreateObjectFromPreset( "Twist", "Operators" );
    op.Connect(obj);