# GetPortReference(Hash128)

> Retrieves a reference to a port in the graph associated with this context, using the port's unique identifier.

## Definition

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

```csharp
public PortReference GetPortReference(Hash128 portID)
```

### Parameters

**** (\[Hash128]\(/engine/6000.6/script-reference/unityengine/hash128)): Unique identifier of the target port.

### Returns

| Type                                                                                                           | Description                                                                                                                                                                                                |
| -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [PortReference](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference.md) | A [PortReference](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference.md) that references the port with the specified ID in the graph associated with this context. |

### Remarks

The returned [PortReference](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference.md) can be used to set, retrieve, or clear the port preview for that specific port in the graph canvas. Throws ObjectDisposedException when you access this property after you call [Context.Dispose](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/context/dispose.md) on the context. Throws ArgumentException when you provide an invalid `portID`.

### Examples

```csharp
context.GetPortReference(portID).SetPreview("42.0");
```
