PortBuilder Class — NXOpen Python API Reference 12.0.0 documentation

# PortBuilder Class

class `NXOpen.Diagramming.``PortBuilder`

  Bases: `NXOpen.Diagramming.SheetElementBuilder`

  Represents a PortBuilder.

  To create a new instance of this class, use `NXOpen.Diagramming.PortCollection.CreatePortBuilder()`

  New in version NX10.0.0.

# Properties

Property | Description
--- | ---
Direction | Returns or sets the direction of the port.
Height | Returns or sets the height.
HeightPolicy | Returns or sets the height policy.
Internal | Returns the flag that indicates if the sheet element is internal.
Label | Returns the label of this sheet element.
LabelName | Returns or sets the label name of this sheet element.
Location | Returns the location of the sheet element relative to another sheet element.
LocationStyle | Returns or sets the location style.
MirrorX | Returns or sets the sheet element to Mirror along the X axis.
MirrorY | Returns or sets the sheet element to Mirror along the Y axis.
NumberAllowedConnections | Returns or sets the maximum number of allowed connections the port may reference.
Owner | Returns or sets the owning sheet element.
OwningSheet | Returns the owning sheet.
Pinned | Returns or sets the flag that indicates the port is pinned.
Proxy | Returns or sets the proxy port for the port inside the super node.
ResizeOption | Returns or sets the resize option of the sheet element
Rotation | Returns or sets the rotation angle that is counter clockwise and relative to the owner.
SourceElement | Returns the source element that records which sheet element it is a copy of.
Tag | Returns the Tag for this object.
UpToDate | Returns the flag that indicates if the sheet element is up to date.
Visible | Returns the flag that indicates if the sheet element is visible.
Width | Returns or sets the width.
WidthPolicy | Returns or sets the width policy.
NXOpen.Diagramming.SheetElementBuilder.X | Returns or sets the absolute x coordinate.
NXOpen.Diagramming.SheetElementBuilder.Y | Returns or sets the absolute y coordinate.
ZDepth | Returns or sets the Z depth.

# Methods

Method | Description
--- | ---
CanAnotherConnectionBeAdded | Get whether another connection can be added or not.
Commit | Commits any edits that have been applied to the builder.
Destroy | Deletes the builder, and cleans up any objects created by the builder.
GetAllowedParentSides | Get allowed parent sides.
GetAllowedTransformations | Get the allowed transformations of the sheet element.
GetCommittedObjects | For builders that create more than one object, this method returns the objects that are created by commit.
GetConnections | Get associated connections.
GetMinNodeSize | Gets the minimum node size values
GetObject | Returns the object currently being edited by this builder.
GetOwningConnectableElement | Get the owner connectable element.
IsNumberOfConnectionInfinite | Get if the number of connections to reference is infinite.
SetMinNodeSize | Sets the minimum node size values
SetOwningSheet | Set the owning sheet when the sheet element is created.
ShowResults | Updates the model to reflect the result of an edit to the model for all builders that support showing results.
Validate | Validate whether the inputs to the component are sufficient for commit to be called.

# Property Detail

## Direction

`PortBuilder.``Direction`

  Returns or sets the direction of the port.

  `-------------------------------------`

  Getter Method

  Signature `Direction`

  Returns: |
  Return type: | `NXOpen.Diagramming.Direction`

  New in version NX10.0.0.

  License requirements: None.

  `-------------------------------------`

  Setter Method

  Signature `Direction`

  Parameters: | direction (`NXOpen.Diagramming.Direction`) –

  New in version NX10.0.0.

  License requirements: None.

## NumberAllowedConnections

`PortBuilder.``NumberAllowedConnections`

  Returns or sets the maximum number of allowed connections the port may reference.

  `-------------------------------------`

  Getter Method

  Signature `NumberAllowedConnections`

  Returns: |
  Return type: | int

  New in version NX10.0.0.

  License requirements: None.

  `-------------------------------------`

  Setter Method

  Signature `NumberAllowedConnections`

  Parameters: | numberAllowedConnections (int) –

  New in version NX10.0.0.

  License requirements: None.

## Pinned

`PortBuilder.``Pinned`

  Returns or sets the flag that indicates the port is pinned.

  If true the port is pinned and cannot be moved.

  `-------------------------------------`

  Getter Method

  Signature `Pinned`

  Returns: |
  Return type: | bool

  New in version NX10.0.0.

  License requirements: None.

  `-------------------------------------`

  Setter Method

  Signature `Pinned`

  Parameters: | isPinned (bool) –

  New in version NX10.0.0.

  License requirements: None.

## Proxy

`PortBuilder.``Proxy`

  Returns or sets the proxy port for the port inside the super node.

  `-------------------------------------`

  Getter Method

  Signature `Proxy`

  Returns: |
  Return type: | `NXOpen.Diagramming.Port`

  New in version NX10.0.0.

  License requirements: None.

  `-------------------------------------`

  Setter Method

  Signature `Proxy`

  Parameters: | proxy (`NXOpen.Diagramming.Port`) –

  New in version NX10.0.0.

  License requirements: None.

# Method Detail

## CanAnotherConnectionBeAdded

`PortBuilder.``CanAnotherConnectionBeAdded`

  Get whether another connection can be added or not.

  Signature `CanAnotherConnectionBeAdded()`

  Returns: |
  Return type: | bool

  New in version NX10.0.0.

  License requirements: None.

## GetAllowedParentSides

`PortBuilder.``GetAllowedParentSides`

  Get allowed parent sides.

  Signature `GetAllowedParentSides()`

  Returns: | a tuple
  Return type: | A tuple consisting of (isAllowedLeftSide, isAllowedRightSide, isAllowedUpSide, isAllowedDownSide) isAllowedLeftSide is a bool. isAllowedRightSide is a bool. isAllowedUpSide is a bool. isAllowedDownSide is a bool.

  New in version NX10.0.0.

  License requirements: None.

## GetConnections

`PortBuilder.``GetConnections`

  Get associated connections.

  Signature `GetConnections()`

  Returns: |
  Return type: | list of `NXOpen.Diagramming.Connection`

  New in version NX10.0.0.

  License requirements: None.

## GetOwningConnectableElement

`PortBuilder.``GetOwningConnectableElement`

  Get the owner connectable element.

  Signature `GetOwningConnectableElement()`

  Returns: |
  Return type: | `NXOpen.Diagramming.ConnectableElement`

  New in version NX10.0.0.

  License requirements: None.

## IsNumberOfConnectionInfinite

`PortBuilder.``IsNumberOfConnectionInfinite`

  Get if the number of connections to reference is infinite.

  If true it is infinite.

  Signature `IsNumberOfConnectionInfinite()`

  Returns: |
  Return type: | bool

  New in version NX10.0.0.

  License requirements: None.

## Validate

`PortBuilder.``Validate`

  Validate whether the inputs to the component are sufficient for commit to be called.

  If the component is not in a state to commit then an exception is thrown. For example, if the component requires you to set some property, this method will throw an exception if you haven’t set it. This method throws a not-yet-implemented NXException for some components.

  Signature `Validate()`

  Returns: | Was self validation successful
  Return type: | bool

  New in version NX3.0.1.

  License requirements: None.