
# IPCB_PadTemplate interface

A pad template, a reusable set of pad properties (layer, hole, offset, solder and paste mask settings and per-layer copper shapes) that pads can be linked to.

```csharp
public interface IPCB_PadTemplate : IPCB_PadViaTemplate
```

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

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

## Remarks

The template's name, identifiers and library are members of [`IPCB_PadViaTemplate`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md). [`IPCB_Board.FindLinkedBoardTemplate`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#findlinkedboardtemplate) returns the template a pad is linked to, as an [`IPCB_PadViaTemplate`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md).

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [HoleRotation](#holerotation) | `double` | get; set | The rotation of the pad's hole; applies to square and slotted holes. |
| [HoleSize](#holesize) | `int` | get; set | The size of the pad's hole, in internal units (10,000 per mil). |
| [HoleType](#holetype) | [TExtendedHoleType](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TExtendedHoleType.md) | get; set | The shape of the pad's hole. |
| [HoleWidth](#holewidth) | `int` | get; set | The width of the pad's hole, in internal units (10,000 per mil), used by square and slotted holes. |
| [IsMultiLayer](#ismultilayer) | `bool` | get; set | Whether the template describes a multi-layer (through-hole) pad. |
| [IsTenting_Bottom](#istenting_bottom) | `bool` | get; set | Whether the pad is tented (covered by solder mask) on the bottom side. |
| [IsTenting_Top](#istenting_top) | `bool` | get; set | Whether the pad is tented (covered by solder mask) on the top side. |
| [ManualPasteMask](#manualpastemask) | `bool` | get; set | Whether the template sets the pad's paste mask itself instead of taking it from the design rules. |
| [ManualSolderMask](#manualsoldermask) | `bool` | get; set | Whether the template sets the pad's solder mask expansion itself instead of taking it from the design rules. |
| [Mode](#mode) | [TPadMode](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TPadMode.md) | get; set | How the pad's copper shape and size are defined on its layers. |
| [OffsetX](#offsetx) | `int` | get; set | The offset in X of the pad's copper shape from the pad's location on all layers, in internal units (10,000 per mil). |
| [OffsetY](#offsety) | `int` | get; set | The offset in Y of the pad's copper shape from the pad's location on all layers, in internal units (10,000 per mil). |
| [PadClass](#padclass) | `string` | get; set | The name of the pad class that the template puts its pads into; empty for none. |
| [PasteMaskExpansion](#pastemaskexpansion) | `int` | get; set | The paste mask expansion of the pad, in internal units (10,000 per mil). |
| [PasteMaskPercent](#pastemaskpercent) | `double` | get; set | The paste mask expansion of the pad as a percentage, used when [`PasteMaskUsePercent`](#pastemaskusepercent) is true. |
| [PasteMaskUsePercent](#pastemaskusepercent) | `bool` | get; set | Whether the paste mask expansion is given as a percentage ([`PasteMaskPercent`](#pastemaskpercent)) instead of a distance ([`PasteMaskExpansion`](#pastemaskexpansion)). |
| [Plated](#plated) | `bool` | get; set | Whether the pad's hole is plated. |
| [SolderMaskBottomExpansion](#soldermaskbottomexpansion) | `int` | get; set | The solder mask expansion of the pad on the bottom side, in internal units (10,000 per mil). |
| [SolderMaskExpansion](#soldermaskexpansion) | `int` | get; set | The solder mask expansion of the pad, in internal units (10,000 per mil). |
| [SolderMaskHoleEdge](#soldermaskholeedge) | `bool` | get; set | Whether the pad's solder mask expansion is measured from the edge of the hole instead of the edge of the copper. |
| [StackData](#stackdata) | [IPCB_PadTemplateStackData](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadTemplateStackData.md) | get; set | An entry of the template's pad stack, which describes the pad's copper shape and size on one layer. |
| [UsePaste](#usepaste) | `bool` | get; set | Whether the pad has a paste mask. |
| [UseSeparateExpansions](#useseparateexpansions) | `bool` | get; set | Whether the pad has separate solder mask expansions for the top side ([`SolderMaskExpansion`](#soldermaskexpansion)) and the bottom side ([`SolderMaskBottomExpansion`](#soldermaskbottomexpansion)). |

### HoleRotation

The rotation of the pad's hole; applies to square and slotted holes.

```csharp
double GetState_HoleRotation();
void SetState_HoleRotation(double argValue);
```

**Type:** `double` · **Access:** read/write

### HoleSize

The size of the pad's hole, in internal units (10,000 per mil).

```csharp
int GetState_HoleSize();
void SetState_HoleSize(int argValue);
```

**Type:** `int` · **Access:** read/write

### HoleType

The shape of the pad's hole.

```csharp
TExtendedHoleType GetState_HoleType();
void SetState_HoleType(TExtendedHoleType argValue);
```

**Type:** [TExtendedHoleType](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TExtendedHoleType.md) · **Access:** read/write

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

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

### HoleWidth

The width of the pad's hole, in internal units (10,000 per mil), used by square and slotted holes.

```csharp
int GetState_HoleWidth();
void SetState_HoleWidth(int argValue);
```

**Type:** `int` · **Access:** read/write

### IsMultiLayer

Whether the template describes a multi-layer (through-hole) pad.

```csharp
bool GetState_IsMultiLayer();
void SetState_IsMultiLayer(bool argValue);
```

**Type:** `bool` · **Access:** read/write

When the template is applied to a pad, a pad that is not on the multi-layer is moved to it when the value is true, and a pad on the multi-layer is moved to the top layer when the value is false.

### IsTenting_Bottom

Whether the pad is tented (covered by solder mask) on the bottom side.

```csharp
bool GetState_IsTenting_Bottom();
void SetState_IsTenting_Bottom(bool argValue);
```

**Type:** `bool` · **Access:** read/write

When the template is applied to a pad, the setting takes effect only for a pad on the multi-layer or the bottom layer.

### IsTenting_Top

Whether the pad is tented (covered by solder mask) on the top side.

```csharp
bool GetState_IsTenting_Top();
void SetState_IsTenting_Top(bool argValue);
```

**Type:** `bool` · **Access:** read/write

When the template is applied to a pad, the setting takes effect only for a pad on the multi-layer or the top layer.

### ManualPasteMask

Whether the template sets the pad's paste mask itself instead of taking it from the design rules.

```csharp
bool GetState_ManualPasteMask();
void SetState_ManualPasteMask(bool argValue);
```

**Type:** `bool` · **Access:** read/write

When the value is false, [`PasteMaskExpansion`](#pastemaskexpansion), [`UsePaste`](#usepaste), [`PasteMaskUsePercent`](#pastemaskusepercent) and [`PasteMaskPercent`](#pastemaskpercent) are not applied to pads, and the applicable design rule decides the paste mask.

### ManualSolderMask

Whether the template sets the pad's solder mask expansion itself instead of taking it from the design rules.

```csharp
bool GetState_ManualSolderMask();
void SetState_ManualSolderMask(bool argValue);
```

**Type:** `bool` · **Access:** read/write

When the value is false, [`SolderMaskExpansion`](#soldermaskexpansion), [`SolderMaskBottomExpansion`](#soldermaskbottomexpansion) and [`UseSeparateExpansions`](#useseparateexpansions) are not applied to pads, and the applicable design rule decides the solder mask expansion.

### Mode

How the pad's copper shape and size are defined on its layers.

```csharp
TPadMode GetState_Mode();
void SetState_Mode(TPadMode argValue);
```

**Type:** [TPadMode](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TPadMode.md) · **Access:** read/write

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

Assigning a different mode replaces the entries of [`StackData`](#stackdata) with default entries: one for the top layer for `TPadMode.ePadMode_Simple`, and one each for the top layer, the mid layers and the bottom layer for `TPadMode.ePadMode_LocalStack` and `TPadMode.ePadMode_ExternalStack`. Assigning the current mode changes nothing.

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

### OffsetX

The offset in X of the pad's copper shape from the pad's location on all layers, in internal units (10,000 per mil).

```csharp
int GetState_OffsetX();
void SetState_OffsetX(int argValue);
```

**Type:** `int` · **Access:** read/write

### OffsetY

The offset in Y of the pad's copper shape from the pad's location on all layers, in internal units (10,000 per mil).

```csharp
int GetState_OffsetY();
void SetState_OffsetY(int argValue);
```

**Type:** `int` · **Access:** read/write

### PadClass

The name of the pad class that the template puts its pads into; empty for none.

```csharp
string GetState_PadClass();
void SetState_PadClass(string argValue);
```

**Type:** `string` · **Access:** read/write

When the template is applied to a pad on a board, the pad is added to the pad class of that name, and the class is created when the board does not have it.

### PasteMaskExpansion

The paste mask expansion of the pad, in internal units (10,000 per mil).

```csharp
int GetState_PasteMaskExpansion();
void SetState_PasteMaskExpansion(int argValue);
```

**Type:** `int` · **Access:** read/write

Applies only when [`ManualPasteMask`](#manualpastemask) is true.

### PasteMaskPercent

The paste mask expansion of the pad as a percentage, used when [`PasteMaskUsePercent`](#pastemaskusepercent) is true.

```csharp
double GetState_PasteMaskPercent();
void SetState_PasteMaskPercent(double argValue);
```

**Type:** `double` · **Access:** read/write

Applies only when [`ManualPasteMask`](#manualpastemask) is true.

### PasteMaskUsePercent

Whether the paste mask expansion is given as a percentage ([`PasteMaskPercent`](#pastemaskpercent)) instead of a distance ([`PasteMaskExpansion`](#pastemaskexpansion)).

```csharp
bool GetState_PasteMaskUsePercent();
void SetState_PasteMaskUsePercent(bool argValue);
```

**Type:** `bool` · **Access:** read/write

Applies only when [`ManualPasteMask`](#manualpastemask) is true.

### Plated

Whether the pad's hole is plated.

```csharp
bool GetState_Plated();
void SetState_Plated(bool argValue);
```

**Type:** `bool` · **Access:** read/write

### SolderMaskBottomExpansion

The solder mask expansion of the pad on the bottom side, in internal units (10,000 per mil).

```csharp
int GetState_SolderMaskBottomExpansion();
void SetState_SolderMaskBottomExpansion(int argValue);
```

**Type:** `int` · **Access:** read/write

Applies only when [`ManualSolderMask`](#manualsoldermask) is true.

### SolderMaskExpansion

The solder mask expansion of the pad, in internal units (10,000 per mil).

```csharp
int GetState_SolderMaskExpansion();
void SetState_SolderMaskExpansion(int argValue);
```

**Type:** `int` · **Access:** read/write

Applies only when [`ManualSolderMask`](#manualsoldermask) is true.

### SolderMaskHoleEdge

Whether the pad's solder mask expansion is measured from the edge of the hole instead of the edge of the copper.

```csharp
bool GetState_SolderMaskHoleEdge();
void SetState_SolderMaskHoleEdge(bool argValue);
```

**Type:** `bool` · **Access:** read/write

### StackData

An entry of the template's pad stack, which describes the pad's copper shape and size on one layer.

```csharp
IPCB_PadTemplateStackData GetState_StackData(int argIndex);
void SetState_StackData(int argIndex, IPCB_PadTemplateStackData argValue);
```

**Type:** [IPCB_PadTemplateStackData](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadTemplateStackData.md) · **Access:** read/write · **Index:** `argIndex` (`int`): The zero-based index of the entry, from 0 to [`StackDataCount`](#stackdatacount) - 1.

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

Reading an entry returns a copy: changes to the returned object take effect only when it is assigned back. Assigning null changes nothing.

When the template is applied to a pad, the entry for each layer is found by its [`IPCB_PadTemplateStackData.Layer`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadTemplateStackData.md#layer); a layer without an entry gets default values (in `TPadMode.ePadMode_ExternalStack`, a mid layer without an entry gets the values of the entry for the mid layers).

### UsePaste

Whether the pad has a paste mask.

```csharp
bool GetState_UsePaste();
void SetState_UsePaste(bool argValue);
```

**Type:** `bool` · **Access:** read/write

Applies only when [`ManualPasteMask`](#manualpastemask) is true.

### UseSeparateExpansions

Whether the pad has separate solder mask expansions for the top side ([`SolderMaskExpansion`](#soldermaskexpansion)) and the bottom side ([`SolderMaskBottomExpansion`](#soldermaskbottomexpansion)).

```csharp
bool GetState_UseSeparateExpansions();
void SetState_UseSeparateExpansions(bool argValue);
```

**Type:** `bool` · **Access:** read/write

Applies only when [`ManualSolderMask`](#manualsoldermask) is true.

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [AddStackData](#addstackdata) | `int` | Adds a per-layer entry to the template's pad stack and returns its index. |
| [ClearStackData](#clearstackdata) | `void` | Removes all entries from the template's pad stack. |
| [CreateDefaultStackData](#createdefaultstackdata) | [IPCB_PadTemplateStackData](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadTemplateStackData.md) | Creates a new pad stack entry with default values. |
| [StackDataCount](#stackdatacount) | `int` | Returns the number of entries in the template's pad stack. |

### AddStackData

Adds a per-layer entry to the template's pad stack and returns its index.

```csharp
int AddStackData(IPCB_PadTemplateStackData argValue);
int AddStackData(object argValue);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argValue` | [IPCB_PadTemplateStackData](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadTemplateStackData.md) | value | The entry to add. The template stores a copy of it. |

**Returns:** `int`

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

Returns -1 and adds nothing when the value is null.

### ClearStackData

Removes all entries from the template's pad stack.

```csharp
void ClearStackData();
```

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

### CreateDefaultStackData

Creates a new pad stack entry with default values.

```csharp
IPCB_PadTemplateStackData CreateDefaultStackData();
```

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

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

The entry is not added to the template; pass it to [`AddStackData`](#addstackdata) or assign it to [`StackData`](#stackdata). It has no layer, a `TShape.eRounded` shape, a size of 60 by 60 mil and a `CRPct` of 50.

### StackDataCount

Returns the number of entries in the template's pad stack.

```csharp
int StackDataCount();
```

**Returns:** `int`

## Inherited members

- From [IPCB_PadViaTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md): [CreateTemplateLink](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#createtemplatelink), [ExternalLink](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#externallink), [GetFullTemplateID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#getfulltemplateid), [HasLocalChanges](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#haslocalchanges), [Internal](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#internal), [LibraryID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#libraryid), [ObjectID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#objectid), [PrimLinkCount](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#primlinkcount), [RemoveUnused](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#removeunused), [RevisionID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#revisionid), [TemplateDescription](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#templatedescription), [TemplateID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#templateid), [TemplateName](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplate.md#templatename)
