
# IPCB_PrimitiveComparator interface

Compares the objects of two boards, or of two groups such as two footprints, layer by layer.

```csharp
public interface IPCB_PrimitiveComparator
```

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

## Remarks

Get it with [`IPCB_ServerInterface.PrimitiveComparator`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ServerInterface.md#primitivecomparator). Both methods switch on the display of difference objects in the PCB editor.

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [Compare](#compare) | `bool` | Compares two boards layer by layer and returns true when no differences are found. |
| [CompareGroup](#comparegroup) | [IPCB_GroupComparisionResult](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_GroupComparisionResult.md) | Compares two groups, such as two footprints, layer by layer and returns the result. |

### Compare

Compares two boards layer by layer and returns true when no differences are found.

```csharp
bool Compare(IPCB_Board argBoardA, IPCB_Board argBoardB, double argTolerance);
bool Compare(object argBoardA, object argBoardB, double argTolerance);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argBoardA` | [IPCB_Board](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md) | value | The first board. |
| `argBoardB` | [IPCB_Board](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md) | value | The second board. |
| `argTolerance` | `double` | value | The smallest area of difference that counts, in square internal units: a connected area without holes that is covered on one board and not on the other is ignored when its area is smaller than this value. One square mil is 100,000,000. |

**Returns:** `bool`

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

The layers of `argBoardA`, except the multi-layer, are compared with the same layers of `argBoardB`. Progress is shown while the comparison runs; pressing Esc cancels it and raises an exception.

### CompareGroup

Compares two groups, such as two footprints, layer by layer and returns the result.

```csharp
IPCB_GroupComparisionResult CompareGroup(IPCB_Group argGroupA, IPCB_Group argGroupB, ref IPCB_LayerSet argLayers, object argPCBViewA, int argNumberOfCells, bool argBShowStatus, string argGroupADescription, string argGroupBDescription);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argGroupA` | [IPCB_Group](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md) | value | The first group. |
| `argGroupB` | [IPCB_Group](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md) | value | The second group. |
| `argLayers` | [IPCB_LayerSet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSet.md) | ref | The layers to compare, or null for all layers that apply. On return it holds the layers that were compared. |
| `argPCBViewA` | `object` | value | The PCB editor view in which the differences are shown. It can be null only when `argBShowStatus` is false; then no differences are drawn. |
| `argNumberOfCells` | `int` | value | The number of cells into which the longer side of the compared area is divided. Ignored when `argPCBViewA` is null. |
| `argBShowStatus` | `bool` | value | True to show the progress of the comparison. |
| `argGroupADescription` | `string` | value | A label for the first group, put in front of the descriptions of its differences ([`IPCB_GroupComparisionResult.GetPrimitiveDescriptorForLayer`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_GroupComparisionResult.md#getprimitivedescriptorforlayer)). |
| `argGroupBDescription` | `string` | value | A label for the second group, put in front of the descriptions of its differences ([`IPCB_GroupComparisionResult.GetPrimitiveDescriptorForLayer`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_GroupComparisionResult.md#getprimitivedescriptorforlayer)). |

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

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

Footprint parameters are compared as well. The layers compared are the layers that the two groups use, the pad and via hole layers, the top and bottom paste and solder mask layers and the multi-layer, limited to the layers in `argLayers`.

## Returned by

[IPCB_ServerInterface.PrimitiveComparator](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ServerInterface.md#primitivecomparator)
