PortConnectionCollection Class — NXOpen Python API Reference 12.0.0 documentation

# PortConnectionCollection Class

class `NXOpen.Routing.``PortConnectionCollection`

  Bases: `object`

  Represents a collection of `NXOpen.Routing.PortConnection` objects.

  To obtain an instance of this class, refer to `NXOpen.Routing.RouteManager`

  New in version NX4.0.0.

# Methods

Method | Description
--- | ---
CanPortsConnect | Determines if the two ports can be connected using a `NXOpen.Routing.PortConnection` object.
CreatePortConnection | Creates a `NXOpen.Routing.PortConnection` object.
GetConnectionFromPort | Returns the `NXOpen.Routing.PortConnection` the given part participates in, if any.

# Enumerations

PortConnectionCollectionPortsStatus Enumeration | Option to check if two ports can be connected by creating a `NXOpen.Routing.PortConnection` object.

# Method Detail

## CanPortsConnect

`PortConnectionCollection.``CanPortsConnect`

  Determines if the two ports can be connected using a `NXOpen.Routing.PortConnection` object.

  Signature `CanPortsConnect(port1, port2)`

  Parameters:

  - port1 (`NXOpen.Routing.Port`) – first Port to be connected by the Port Connection object
  - port2 (`NXOpen.Routing.Port`) – second Port to be connected by the Port Connection object

  Returns: |
  Return type: | `NXOpen.Routing.PortConnectionCollectionPortsStatus`

  New in version NX4.0.0.

  License requirements: routing_base (“Routing Basic”)

## CreatePortConnection

`PortConnectionCollection.``CreatePortConnection`

  Creates a `NXOpen.Routing.PortConnection` object.

  Signature `CreatePortConnection(port1, port2)`

  Parameters:

  - port1 (`NXOpen.Routing.Port`) – first Port to be connected by the Port Connection object
  - port2 (`NXOpen.Routing.Port`) – second Port to be connected by the Port Connection object

  Returns: |
  Return type: | `NXOpen.Routing.PortConnection`

  New in version NX4.0.0.

  License requirements: routing_base (“Routing Basic”)

## GetConnectionFromPort

`PortConnectionCollection.``GetConnectionFromPort`

  Returns the `NXOpen.Routing.PortConnection` the given part participates in, if any.

  Signature `GetConnectionFromPort(port)`

  Parameters: | port (`NXOpen.Routing.Port`) –
  Returns: |
  Return type: | `NXOpen.Routing.PortConnection`

  New in version NX11.0.0.

  License requirements: routing_base (“Routing Basic”)