# IPort

> Interface for a node port.

## Definition

* **Type:** Interface
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.6/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
public interface IPort
```

## Remarks

Use this interface to access port metadata and connectivity.

A port represents an input or output slot on a node and users can connect ports to other ports to form graph relationships. Each port has a unique name within its node context, a data type, and a direction. Users can only connect a port to another port if they are compatible as follows: The ports must have opposite [PortDirection](/engine/6000.6/script-reference/unity/graphtoolkit/editor/portdirection.md) (i.e., one input and one output).Either both ports must have the same data type or the output port must be a derived data type and the input port, a base data type. Of course the derived data type must be derived from the same base type.

To retrieve the node that owns the port, use `INodeExtensions.GetNode`.

## Properties

| Property                                                                                                    | Description                                                          |
| ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [DataType](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport/datatype.md)                     | The data type associated with the port.                              |
| [Direction](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport/direction.md)                   | The direction of the port.                                           |
| [DisplayName](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport/displayname.md)               | The label displayed in the UI for the port.                          |
| [FirstConnectedPort](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport/firstconnectedport.md) | The first port connected to this port, if any.                       |
| [ID](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport/id.md)                                 | The globally unique identifier for this port.                        |
| [IsConnected](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport/isconnected.md)               | Indicates whether the port is currently connected to any other port. |
| [Name](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport/name.md)                             | The unique identifier name of the port.                              |
| [Tooltip](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport/tooltip.md)                       | The text displayed when hovering over the port's label.              |

## Methods

| Method                                                                                                    | Description                                                  |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [GetConnectedPorts](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport/getconnectedports.md) | Retrieves all ports connected to this port.                  |
| [TryGetValue](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport/trygetvalue.md)             | Retrieves the current value assigned to the port’s UI field. |
| [TrySetValue](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport/trysetvalue.md)             | Sets a new value to the port's UI field.                     |
