# WithCapacity(PortCapacity)

> Configures the connection capacity of the port being built.

## Definition

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

```csharp
T WithCapacity(PortCapacity capacity)
```

### Parameters

**** (\[PortCapacity]\(/engine/6000.6/script-reference/unity/graphtoolkit/editor/portcapacity)): The number of connections the port can accept, represented by [PortCapacity](/engine/6000.6/script-reference/unity/graphtoolkit/editor/portcapacity.md).

### Returns

| Type | Description                                       |
| ---- | ------------------------------------------------- |
| T    | The current builder instance for method chaining. |

### Remarks

Use this method to control how many connections a port can accept. By default, input ports use [PortCapacity.Single](/engine/6000.6/script-reference/unity/graphtoolkit/editor/portcapacity/single.md) and output ports use [PortCapacity.Multi](/engine/6000.6/script-reference/unity/graphtoolkit/editor/portcapacity/multi.md). Call this method before [IPortBuilder\<T>.Build()](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iportbuilder1/build.md) to ensure the capacity is applied.
