
# IPCB_PadViaTemplate interface

The common base of pad templates ([`IPCB_PadTemplate`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadTemplate.md)) and via templates ([`IPCB_ViaTemplate`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ViaTemplate.md)), with the identity, name and description they share.

```csharp
public interface IPCB_PadViaTemplate
```

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

**Derived:** [IPCB_PadTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadTemplate.md), [IPCB_ViaTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ViaTemplate.md)

## Remarks

[`IPCB_Board.FindLinkedBoardTemplate`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#findlinkedboardtemplate) returns the template a pad or via is linked to as an `IPCB_PadViaTemplate`; [`ObjectID`](#objectid) tells a pad template from a via template.

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [ExternalLink](#externallink) | [IPCB_PadViaTemplateLink](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplateLink.md) | get | The template's external link, which holds the library, template and revision identifiers of an external template. |
| [Internal](#internal) | `bool` | get; set |  |
| [LibraryID](#libraryid) | `string` | get; set | The identifier of the pad and via library that the template belongs to. |
| [ObjectID](#objectid) | [TObjectId](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TObjectId.md) | get | The object type of the template, `TObjectId.ePadObject` for a pad template and `TObjectId.eViaObject` for a via template. |
| [PrimLinkCount](#primlinkcount) | `int` | get | The number of pads or vias that are linked to the template. |
| [RemoveUnused](#removeunused) | `bool` | get; set |  |
| [RevisionID](#revisionid) | `string` | get; set | The revision identifier of the template. |
| [TemplateDescription](#templatedescription) | `string` | get; set | The free-text description of the template. |
| [TemplateID](#templateid) | `string` | get; set | The identifier of the template within its library. |
| [TemplateName](#templatename) | `string` | get; set | The display name of the template. |

### ExternalLink

The template's external link, which holds the library, template and revision identifiers of an external template.

```csharp
IPCB_PadViaTemplateLink GetState_ExternalLink();
```

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

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

The returned object is the template's own link, not a copy. Its identifiers are empty for a new template.

### Internal

*No description yet.*

```csharp
bool GetState_Internal();
void SetState_Internal(bool argValue);
```

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

### LibraryID

The identifier of the pad and via library that the template belongs to.

```csharp
string GetState_LibraryID();
void SetState_LibraryID(string argValue);
```

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

Empty for a new template.

### ObjectID

The object type of the template, `TObjectId.ePadObject` for a pad template and `TObjectId.eViaObject` for a via template.

```csharp
TObjectId GetState_ObjectID();
```

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

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

### PrimLinkCount

The number of pads or vias that are linked to the template.

```csharp
int GetState_PrimLinkCount();
```

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

### RemoveUnused

*No description yet.*

```csharp
bool GetState_RemoveUnused();
void SetState_RemoveUnused(bool argValue);
```

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

### RevisionID

The revision identifier of the template.

```csharp
string GetState_RevisionID();
void SetState_RevisionID(string argValue);
```

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

Empty for a new template.

### TemplateDescription

The free-text description of the template.

```csharp
string GetState_TemplateDescription();
void SetState_TemplateDescription(string argValue);
```

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

Empty for a new template.

### TemplateID

The identifier of the template within its library.

```csharp
string GetState_TemplateID();
void SetState_TemplateID(string argValue);
```

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

A new template gets a newly generated GUID string.

### TemplateName

The display name of the template.

```csharp
string GetState_TemplateName();
void SetState_TemplateName(string argValue);
```

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

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [CreateTemplateLink](#createtemplatelink) | [IPCB_PadViaTemplateLink](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaTemplateLink.md) | Creates a new template link that holds the template's [`LibraryID`](#libraryid), [`TemplateID`](#templateid) and [`RevisionID`](#revisionid). |
| [GetFullTemplateID](#getfulltemplateid) | `string` | Returns the template's full identifier, its [`LibraryID`](#libraryid) and [`TemplateID`](#templateid) joined by `@`. |
| [HasLocalChanges](#haslocalchanges) | `bool` | Returns whether a pad or via differs from the template. |

### CreateTemplateLink

Creates a new template link that holds the template's [`LibraryID`](#libraryid), [`TemplateID`](#templateid) and [`RevisionID`](#revisionid).

```csharp
IPCB_PadViaTemplateLink CreateTemplateLink();
```

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

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

The link is a separate object; changing it does not change the template.

### GetFullTemplateID

Returns the template's full identifier, its [`LibraryID`](#libraryid) and [`TemplateID`](#templateid) joined by `@`.

```csharp
string GetFullTemplateID();
```

**Returns:** `string`

### HasLocalChanges

Returns whether a pad or via differs from the template.

```csharp
bool HasLocalChanges(IPCB_Primitive argPrimitive);
bool HasLocalChanges(object argPrimitive);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPrimitive` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value | The pad or via to compare with the template. |

**Returns:** `bool`

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

## Returned by

[IPCB_Board.FindLinkedBoardTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#findlinkedboardtemplate), [IPCB_PadViaLibrary.AddExternalTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibrary.md#addexternaltemplate), [IPCB_PadViaLibrary.FindTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibrary.md#findtemplate), [IPCB_PadViaLibrary.FindTemplate_1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibrary.md#findtemplate_1), [IPCB_PadViaLibrary.Template](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibrary.md#template), [IPCB_PadViaLibraryDocument.CurrentTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibraryDocument.md#currenttemplate), [IPCB_PadViaLibraryManager.CreateTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibraryManager.md#createtemplate)

## Accepted by

[IPCB_Board.LinkToTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#linktotemplate), [IPCB_PadViaLibrary.AddExternalTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibrary.md#addexternaltemplate), [IPCB_PadViaLibrary.AddTemplate_1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibrary.md#addtemplate_1), [IPCB_PadViaLibrary.CheckDublicate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibrary.md#checkdublicate), [IPCB_PadViaLibrary.RemoveTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibrary.md#removetemplate), [IPCB_PadViaLibraryManager.ExchangeTemplatesOnPrimitives](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibraryManager.md#exchangetemplatesonprimitives), [IPCB_PadViaLibraryManager.GetLibraryName_1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibraryManager.md#getlibraryname_1), [IPCB_PadViaLibraryManager.GetTemplateNameWithDynamicName](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibraryManager.md#gettemplatenamewithdynamicname), [IPCB_PadViaLibraryManager.PlaceTemplate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibraryManager.md#placetemplate)
