
# IPCB_PinPairsManager interface

The manager of the pin pairs (xSignals) of a PCB document.

```csharp
public interface IPCB_PinPairsManager
```

**Namespace:** PCB · **Assembly:** Altium.SDK.Interfaces

## Remarks

The manager of a board is [`IPCB_Board.PinPairsManager`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#pinpairsmanager). It lists the pin pairs ([`PinPairsCount`](#pinpairscount), [`PinPairs`](#pinpairs)), creates and removes them, and groups them into xSignal classes.

A pin pair is out of date after it was created from pin descriptors or after its pins were swapped, until its signal path is calculated again. [`InvalidateAll`](#invalidateall) recalculates every pin pair that is out of date.

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [PinPairs](#pinpairs) | [IPCB_PinPair](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md) | get | Returns a pin pair of the board, by index. |
| [PinPairsCount](#pinpairscount) | `int` | get | The number of pin pairs of the board. |

### PinPairs

Returns a pin pair of the board, by index.

```csharp
IPCB_PinPair GetState_PinPairs(int argIndex);
```

**Type:** [IPCB_PinPair](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md) · **Access:** read-only · **Index:** `argIndex` (`int`): The zero-based index of the pin pair.

The accessors are extension methods of `IPCB_PinPairsManagerHelper` (`using PCB;`).

Returns null when the index is outside the range 0 to [`PinPairsCount`](#pinpairscount) - 1.

### PinPairsCount

The number of pin pairs of the board.

```csharp
int GetState_PinPairsCount();
```

**Type:** `int` · **Access:** read-only

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [AssignPinPairClass](#assignpinpairclass) | `void` | Adds pin pairs to an xSignal class, and creates the class on the board when there is no xSignal class of that name. |
| [CanCreateTiePoints](#cancreatetiepoints) | `bool` | Returns whether tie points can be created for the given pin pairs. |
| [CreateFromPins](#createfrompins) | [IPCB_PinPair](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md) | Creates a pin pair from pins and adds it to the board. |
| [CreateFromPinsDescriptors](#createfrompinsdescriptors) | [IPCB_PinPair](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md) | Creates a pin pair from a string of pin descriptors and adds it to the board. |
| [CreateTiePoints](#createtiepoints) | [IInterfaceList](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IInterfaceList.md) |  |
| [Delete](#delete) | `void` | Removes a pin pair from the manager and from the board. |
| [GetPinPairOf](#getpinpairof) | [IPCB_PinPair](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md) | Returns a pin pair whose pins or signal path include the given primitive. |
| [InvalidateAll](#invalidateall) | `void` | Recalculates the signal path of every pin pair that is out of date. |
| [StateID](#stateid) | `long` | Returns a counter that increases each time a pin pair is added to or removed from the manager. |
| [SwapPins](#swappins) | [IInterfaceList](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IInterfaceList.md) | Exchanges two pins in every pin pair that contains them, and returns the pin pairs that changed. |

### AssignPinPairClass

Adds pin pairs to an xSignal class, and creates the class on the board when there is no xSignal class of that name.

```csharp
void AssignPinPairClass(IInterfaceList argPinPairs, string argClassName);
void AssignPinPairClass(object argPinPairs, string argClassName);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPinPairs` | [IInterfaceList](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IInterfaceList.md) | value | The pin pairs to add, as [`IPCB_PinPair`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md) items. |
| `argClassName` | `string` | value | The name of the xSignal class. |

**Returns:** nothing (`void`)

The first overload is an extension method of `IPCB_PinPairsManagerHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

The class is an [`IPCB_ObjectClass`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md) whose `MemberKind` is `TClassMemberKind.eClassMemberKind_Signal`; each pin pair is added by its `Name`. Nothing is added to a class whose `SuperClass` is true. The class name is compared case-sensitively; a name that differs only in case creates another class.

### CanCreateTiePoints

Returns whether tie points can be created for the given pin pairs.

```csharp
bool CanCreateTiePoints(IInterfaceList argPinPairs);
bool CanCreateTiePoints(object argPinPairs);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPinPairs` | [IInterfaceList](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IInterfaceList.md) | value | The pin pairs to check. Items that are not [`IPCB_PinPair`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md) are ignored. |

**Returns:** `bool`

The first overload is an extension method of `IPCB_PinPairsManagerHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

The pin pairs are grouped by the primitive at which they start or end; the result is true when a tie point can be placed for at least one group of two or more pin pairs. Returns false when fewer than two pin pairs are given.

### CreateFromPins

Creates a pin pair from pins and adds it to the board.

```csharp
IPCB_PinPair CreateFromPins(IInterfaceList argPins);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPins` | [IInterfaceList](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IInterfaceList.md) | value | The pins of the pin pair, as [`IPCB_Primitive`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) items. |

**Returns:** [IPCB_PinPair](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md)

Extension method of `IPCB_PinPairsManagerHelper` (`using PCB;`).

The pin pair gets a unique name made of the names of its pins' nets, `_PP` and a number, and its signal path is calculated at once. Returns null when no list is given.

### CreateFromPinsDescriptors

Creates a pin pair from a string of pin descriptors and adds it to the board.

```csharp
IPCB_PinPair CreateFromPinsDescriptors(string argPins);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPins` | `string` | value | The pin descriptors, separated by `\|`. A descriptor is a component designator, `-` and a pad name, for example `U1-16\|U4-23`. |

**Returns:** [IPCB_PinPair](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md)

Extension method of `IPCB_PinPairsManagerHelper` (`using PCB;`).

The pin pair gets a unique name in the same way as with [`CreateFromPins`](#createfrompins). It is out of date until its signal path is calculated: when its lengths, delay or primitives are first read, or by [`InvalidateAll`](#invalidateall) or [`IPCB_PinPair.Rebuild`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md#rebuild). Returns null when the string contains an empty descriptor.

### CreateTiePoints

*No description yet.*

```csharp
IInterfaceList CreateTiePoints(IInterfaceList argPinPairs);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argPinPairs` | [IInterfaceList](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IInterfaceList.md) | value |

**Returns:** [IInterfaceList](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IInterfaceList.md)

Extension method of `IPCB_PinPairsManagerHelper` (`using PCB;`).

### Delete

Removes a pin pair from the manager and from the board.

```csharp
void Delete(IPCB_PinPair argPinPair);
void Delete(object argPinPair);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPinPair` | [IPCB_PinPair](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md) | value | The pin pair to remove. |

**Returns:** nothing (`void`)

The first overload is an extension method of `IPCB_PinPairsManagerHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

Does nothing when no pin pair is given or the pin pair does not belong to this manager.

### GetPinPairOf

Returns a pin pair whose pins or signal path include the given primitive.

```csharp
IPCB_PinPair GetPinPairOf(IPCB_Primitive argPrimitive);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPrimitive` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value | The primitive to look up, for example a pad or a track. |

**Returns:** [IPCB_PinPair](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md)

Extension method of `IPCB_PinPairsManagerHelper` (`using PCB;`).

Returns null when the primitive belongs to no pin pair. When it belongs to several pin pairs, one of them is returned. Only pin pairs whose signal path has been calculated are found; call [`InvalidateAll`](#invalidateall) first to include pin pairs that are out of date.

### InvalidateAll

Recalculates the signal path of every pin pair that is out of date.

```csharp
void InvalidateAll();
```

**Returns:** nothing (`void`)

Pin pairs that are up to date are not changed. Reading the lengths, the delay or the primitives of an out-of-date pin pair ([`IPCB_PinPair.Length`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md#length), [`IPCB_PinPair.DelayTotal`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md#delaytotal), [`IPCB_PinPair.GetPrimitives`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md#getprimitives)) recalculates it first; [`GetPinPairOf`](#getpinpairof) and [`IPCB_PinPair.NodeCount`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PinPair.md#nodecount) do not, so call `InvalidateAll` before using them.

### StateID

Returns a counter that increases each time a pin pair is added to or removed from the manager.

```csharp
long StateID();
```

**Returns:** `long`

### SwapPins

Exchanges two pins in every pin pair that contains them, and returns the pin pairs that changed.

```csharp
IInterfaceList SwapPins(IPCB_Primitive argPinA, IPCB_Primitive argPinB, IPCB_Net argOldNetA, IPCB_Net argOldNetB);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPinA` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value | The first pin. |
| `argPinB` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value | The second pin. |
| `argOldNetA` | [IPCB_Net](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Net.md) | value | Not used. |
| `argOldNetB` | [IPCB_Net](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Net.md) | value | Not used. |

**Returns:** [IInterfaceList](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IInterfaceList.md)

Extension method of `IPCB_PinPairsManagerHelper` (`using PCB;`).

Each changed pin pair is out of date until its signal path is calculated again. Returns an empty list when a pin is not given or both are the same pin.

## Returned by

[IPCB_Board.PinPairsManager](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#pinpairsmanager)
