# GetWire(IPort, IPort)

> Gets the representation of the wire between an output port and an input port in the graph, if such a connection exists.

## Definition

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

```csharp
public Wire GetWire(IPort output, IPort input)
```

### Parameters

**** (\[IPort]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/iport)): The output port at the start of the connection.**** (\[IPort]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/iport)): The input port at the end of the connection.

### Returns

| Type                                                                      | Description                                                                                                                                             |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Wire](/engine/6000.7/script-reference/unity/graphtoolkit/editor/wire.md) | A [Wire](/engine/6000.7/script-reference/unity/graphtoolkit/editor/wire.md) when the ports are connected (including through portals); otherwise `null`. |
