
# IPCB_Primitive2 interface

Additional members of PCB objects for solder mask and paste mask expansion, routing widths from the design rules, and shared unions.

```csharp
public interface IPCB_Primitive2
```

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

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [IsEmbeddedComponentCavity](#isembeddedcomponentcavity) | `bool` | get | Whether the object is a board region ([`IPCB_BoardRegion`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardRegion.md)) that belongs to a component, the cavity of an embedded component. |
| [PasteMaskEnabled](#pastemaskenabled) | `bool` | get; set | Whether the object has a paste mask. |
| [PasteMaskExpansion](#pastemaskexpansion) | `int` | get; set | The paste mask expansion of the object, in internal units (10,000 per mil). |
| [PasteMaskExpansionMode](#pastemaskexpansionmode) | [TMaskExpansionMode](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TMaskExpansionMode.md) | get; set | How the object's paste mask expansion is determined. |
| [PasteMaskPercent](#pastemaskpercent) | `double` | get; set | The percentage from which a pad's manual paste mask expansion is computed when [`PasteMaskUsePercent`](#pastemaskusepercent) is true. |
| [PasteMaskUsePercent](#pastemaskusepercent) | `bool` | get; set | Whether a pad's manual paste mask expansion is computed from [`PasteMaskPercent`](#pastemaskpercent) and the pad's shape instead of being an absolute value. |
| [RoutingMinWidth](#routingminwidth) | `int` | get | The minimum width allowed by the width rule that applies to the object, in internal units (10,000 per mil). |
| [RoutingViaWidth](#routingviawidth) | `int` | get | The preferred via width of the routing via style rule that applies to the object, in internal units (10,000 per mil). |
| [SharedUnion](#sharedunion) | [IPCB_SharedUnion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SharedUnion.md) | get; set | The shared union assigned to the object. |
| [SolderMaskExpansion](#soldermaskexpansion) | `int` | get; set | The solder mask expansion of the object, in internal units (10,000 per mil). |
| [SolderMaskExpansionMode](#soldermaskexpansionmode) | [TMaskExpansionMode](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TMaskExpansionMode.md) | get; set | How the object's solder mask expansion is determined. |

### IsEmbeddedComponentCavity

Whether the object is a board region ([`IPCB_BoardRegion`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardRegion.md)) that belongs to a component, the cavity of an embedded component.

```csharp
bool GetState_IsEmbeddedComponentCavity();
```

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

False for every other kind of object.

### PasteMaskEnabled

Whether the object has a paste mask.

```csharp
bool GetState_PasteMaskEnabled();
void SetState_PasteMaskEnabled(bool argValue);
```

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

Assigning true to an object other than a pad, track, arc, fill or region stores false.

### PasteMaskExpansion

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

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

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

Reading returns the same value as [`IPCB_Primitive.PasteMaskExpansion`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#pastemaskexpansion). For objects other than pads and vias, assigning a value makes it the object's manual expansion and sets [`PasteMaskExpansionMode`](#pastemaskexpansionmode) to `TMaskExpansionMode.eMaskExpansionMode_Manual`.

### PasteMaskExpansionMode

How the object's paste mask expansion is determined.

```csharp
TMaskExpansionMode GetState_PasteMaskExpansionMode();
void SetState_PasteMaskExpansionMode(TMaskExpansionMode argValue);
```

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

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

For objects other than pads and vias, [`PasteMaskExpansion`](#pastemaskexpansion) is 0 with `TMaskExpansionMode.eMaskExpansionMode_NoMask`, comes from the paste mask expansion rule that applies to the object with `TMaskExpansionMode.eMaskExpansionMode_Rule`, and is the object's manual expansion with `TMaskExpansionMode.eMaskExpansionMode_Manual`.

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

### PasteMaskPercent

The percentage from which a pad's manual paste mask expansion is computed when [`PasteMaskUsePercent`](#pastemaskusepercent) is true.

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

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

### PasteMaskUsePercent

Whether a pad's manual paste mask expansion is computed from [`PasteMaskPercent`](#pastemaskpercent) and the pad's shape instead of being an absolute value.

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

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

Applies only to pads whose [`PasteMaskExpansionMode`](#pastemaskexpansionmode) is `TMaskExpansionMode.eMaskExpansionMode_Manual`.

### RoutingMinWidth

The minimum width allowed by the width rule that applies to the object, in internal units (10,000 per mil).

```csharp
int GetState_RoutingMinWidth();
```

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

10 mil when no width rule applies.

### RoutingViaWidth

The preferred via width of the routing via style rule that applies to the object, in internal units (10,000 per mil).

```csharp
int GetState_RoutingViaWidth();
```

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

50 mil when no routing via style rule applies.

### SharedUnion

The shared union assigned to the object.

```csharp
IPCB_SharedUnion GetState_SharedUnion();
void SetState_SharedUnion(IPCB_SharedUnion argValue);
```

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

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

[`CreateSharedUnion`](#createsharedunion) creates a new one.

### SolderMaskExpansion

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

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

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

Reading returns the same value as [`IPCB_Primitive.SolderMaskExpansion`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#soldermaskexpansion). For objects other than pads and vias, assigning a value makes it the object's manual expansion and sets [`SolderMaskExpansionMode`](#soldermaskexpansionmode) to `TMaskExpansionMode.eMaskExpansionMode_Manual`.

### SolderMaskExpansionMode

How the object's solder mask expansion is determined.

```csharp
TMaskExpansionMode GetState_SolderMaskExpansionMode();
void SetState_SolderMaskExpansionMode(TMaskExpansionMode argValue);
```

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

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

For objects other than pads and vias, [`SolderMaskExpansion`](#soldermaskexpansion) is 0 with `TMaskExpansionMode.eMaskExpansionMode_NoMask`, comes from the solder mask expansion rule that applies to the object with `TMaskExpansionMode.eMaskExpansionMode_Rule`, and is the object's manual expansion with `TMaskExpansionMode.eMaskExpansionMode_Manual`.

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

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [CreateSharedUnion](#createsharedunion) | `void` | Creates a new shared union for the object and assigns it to [`SharedUnion`](#sharedunion). |
| [GetGUID](#getguid) | `string` |  |
| [HasMaskExpansion](#hasmaskexpansion) | `bool` | Returns whether the object has a mask opening on the given solder mask or paste mask layer. |
| [MaskExpansion](#maskexpansion) | `int` | Returns the object's mask expansion on the given solder mask or paste mask layer, in internal units (10,000 per mil). |

### CreateSharedUnion

Creates a new shared union for the object and assigns it to [`SharedUnion`](#sharedunion).

```csharp
void CreateSharedUnion();
```

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

In the new shared union, `LayerIsVisible` is true for the top and bottom paste mask layers when [`PasteMaskEnabled`](#pastemaskenabled) is true, and for the top or bottom solder mask layer when that side of the object is not tented (`IsTenting_Top`, `IsTenting_Bottom`).

### GetGUID

*No description yet.*

```csharp
string GetGUID();
```

**Returns:** `string`

### HasMaskExpansion

Returns whether the object has a mask opening on the given solder mask or paste mask layer.

```csharp
bool HasMaskExpansion(V7_LayerBase argMaskLayer);
bool HasMaskExpansion(IV7_Layer argMaskLayer);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argMaskLayer` | [V7_LayerBase](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/V7_LayerBase.md) | value | A solder mask or paste mask layer. |

**Returns:** `bool`

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

Returns false for objects other than tracks, arcs, fills, regions, pads and vias, and when the object is not on the outer copper layer on the mask layer's side; an object on `TV6_Layer.eV6_MultiLayer` counts on both sides. For a solder mask layer, returns true when [`SolderMaskExpansionMode`](#soldermaskexpansionmode) is not `TMaskExpansionMode.eMaskExpansionMode_NoMask` and that side of the object is not tented.

### MaskExpansion

Returns the object's mask expansion on the given solder mask or paste mask layer, in internal units (10,000 per mil).

```csharp
int MaskExpansion(V7_LayerBase argMaskLayer);
int MaskExpansion(IV7_Layer argMaskLayer);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argMaskLayer` | [V7_LayerBase](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/V7_LayerBase.md) | value | A solder mask or paste mask layer. |

**Returns:** `int`

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

For a paste mask layer, the result is the object's paste mask expansion; for a solder mask layer, its solder mask expansion. For pads and vias, the solder mask expansion is computed for the given layer.
