## PortCollection

### Introduced

v4.0

### Description

A collection of Port objects that represent the Port objects of an Operator object. This collection is 0-based.

### Methods

Filter | Find | GetAsText |

### Properties

Count | Item |  |

### Examples

#### JScript Example

    // This example illustrates how to access the ports collection
    // while browsing the built operator.
    var op = XSIFactory.CreateObjectFromPreset( "Loft", "Operators" );
    var ePortGroups = new Enumerator(op.portgroups);
    for ( ; ! ePortGroups.atEnd(); ePortGroups.moveNext() )
    {
            var portgroup = ePortGroups.item();
            logmessage( "portgroup: " + portgroup.name );
            var ePorts = new Enumerator(portgroup.ports);
            for ( ; ! ePorts.atEnd(); ePorts.moveNext() )
            {
                    var port = ePorts.item();
                    logmessage( "port: " + port.name );
            }
    }

### See Also

PortGroup.Ports CustomOperator.AddIOPort