
# IPCB_PrimitiveCounter interface

Counts the objects of a PCB document; [`IPCB_Board.GetPrimitiveCounter`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#getprimitivecounter) returns it.

```csharp
public interface IPCB_PrimitiveCounter
```

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

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [GetCount](#getcount) | `uint` | Counts the objects of a set of object types. |
| [GetHoleCount](#getholecount) | `uint` | Returns the number of holes of the given hole type on the board. |
| [GetObjectCount](#getobjectcount) | `uint` | Returns the number of objects of the given object type. |
| [GetStringCount](#getstringcount) | `uint` | Returns the number of text strings on the board. |

### GetCount

Counts the objects of a set of object types.

```csharp
uint GetCount(TObjectSet argObjectSet);
uint GetCount(ITransportSet argObjectSet);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argObjectSet` | [TObjectSet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TObjectSet.md) | value | The object types to count. |

**Returns:** `uint`

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

**See also:** [TObjectSet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TObjectSet.md)

### GetHoleCount

Returns the number of holes of the given hole type on the board.

```csharp
uint GetHoleCount(TExtendedHoleType argHoleType);
uint GetHoleCount(int argHoleType);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argHoleType` | [TExtendedHoleType](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TExtendedHoleType.md) | value | The hole shape to count. |

**Returns:** `uint`

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

### GetObjectCount

Returns the number of objects of the given object type.

```csharp
uint GetObjectCount(TObjectId argObjectId);
uint GetObjectCount(int argObjectId);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argObjectId` | [TObjectId](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TObjectId.md) | value |

**Returns:** `uint`

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

### GetStringCount

Returns the number of text strings on the board.

```csharp
uint GetStringCount();
```

**Returns:** `uint`

Text objects (`TObjectId.eTextObject`) are counted, except the designator and comment of each component.

## Returned by

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