
# IPCB_LayerSet interface

A set of PCB layers, for example to restrict an iterator to those layers with [`IPCB_AbstractIterator.AddFilter_IPCB_LayerSet`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_AbstractIterator.md#addfilter_ipcb_layerset).

```csharp
public interface IPCB_LayerSet
```

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

## Remarks

New layer sets are created with [`IPCB_LayerSetUtils`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md) (from [`IPCB_ServerInterface.LayerSet`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ServerInterface.md#layerset)), for example with `CreateLayerSet`, `EmptySet` or `AllLayers`.

A set keeps signal, mechanical, internal plane, standard and dielectric layers as separate groups. A group is either included as a whole ([`IncludeSignalLayers`](#includesignallayers) and similar), with individual layers then excluded from it by `Exclude`, or not included, with individual layers added by `Include`. Including or excluding a whole group discards the individual exceptions recorded for that group.

`Include`, `Exclude` and the methods that include or exclude a whole group change this set and return it, so calls can be chained. `Complement`, `Intersection`, `Union` and `Replicate` return a new set and leave this set unchanged.

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [Complement](#complement) | [IPCB_LayerSet](#) | Returns a new set that contains exactly the layers this set does not contain. |
| [Contains](#contains) | `bool` | Returns whether the set contains the given layer. |
| [ContainsInternalPlaneLayers](#containsinternalplanelayers) | `bool` | Returns true when the set includes the internal plane layers as a group or contains at least one internal plane layer added individually. |
| [EqualTo](#equalto) | `bool` | Returns whether this set and the given set contain exactly the same layers. |
| [EqualTo_1](#equalto_1) | `bool` | Returns whether the set contains exactly the layers of the given set of layer values. |
| [Exclude](#exclude) | [IPCB_LayerSet](#) | Removes the given layer from the set and returns the set. |
| [Exclude_1](#exclude_1) | [IPCB_LayerSet](#) | Removes each layer of the given set of layer values from the set and returns the set. |
| [ExcludeAllLayers](#excludealllayers) | [IPCB_LayerSet](#) |  |
| [ExcludeInternalPlaneLayers](#excludeinternalplanelayers) | [IPCB_LayerSet](#) | Removes all internal plane layers from the set, including those added individually, and returns the set. |
| [ExcludeMechanicalLayers](#excludemechanicallayers) | [IPCB_LayerSet](#) | Removes all mechanical layers from the set, including those added individually, and returns the set. |
| [ExcludeSignalLayers](#excludesignallayers) | [IPCB_LayerSet](#) | Removes all signal layers from the set, including those added individually, and returns the set. |
| [GetFirstLayer](#getfirstlayer) | [V7_LayerBase](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/V7_LayerBase.md) | Returns one layer of the set, or no layer when the set is empty. |
| [Include](#include) | [IPCB_LayerSet](#) | Adds the given layer to the set and returns the set. |
| [IncludeAllLayers](#includealllayers) | [IPCB_LayerSet](#) | Includes the signal, internal plane, mechanical and standard layer groups as a whole and returns the set. |
| [IncludeInternalPlaneLayers](#includeinternalplanelayers) | [IPCB_LayerSet](#) | Adds all internal plane layers to the set and returns the set. |
| [IncludeMechanicalLayers](#includemechanicallayers) | [IPCB_LayerSet](#) | Adds all mechanical layers to the set and returns the set. |
| [IncludeMiscLayers](#includemisclayers) | [IPCB_LayerSet](#) | Adds all standard layers to the set and returns the set; the same as [`IncludeStandardLayers`](#includestandardlayers). |
| [IncludeSignalLayers](#includesignallayers) | [IPCB_LayerSet](#) | Adds all signal layers to the set and returns the set. |
| [IncludeStandardLayers](#includestandardlayers) | [IPCB_LayerSet](#) | Adds all standard layers to the set and returns the set. |
| [Intersection](#intersection) | [IPCB_LayerSet](#) | Returns a new set with the layers that are in both this set and the given set. |
| [IsAllLayers](#isalllayers) | `bool` | Returns true when the set includes every layer group (signal, mechanical, internal plane, standard and dielectric layers) as a whole, with no layer excluded. |
| [IsEmpty](#isempty) | `bool` | Returns true when the set contains no layer. |
| [IsFinite](#isfinite) | `bool` | Returns false when the set includes at least one layer group as a whole with no layer excluded from it; otherwise true. |
| [LayerIterator](#layeriterator) | [IPCB_LayerIterator](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerIterator.md) | Returns an iterator over the layers of the set. |
| [Replicate](#replicate) | [IPCB_LayerSet](#) | Returns an independent copy of the set; changing the copy does not change this set. |
| [SerializeToString](#serializetostring) | `string` | Returns the set as a string from which [`IPCB_LayerSetUtils.SerializeFromString`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#serializefromstring) creates an equal set. |
| [ToString](#tostring) | `string` | Returns a readable description of the set, listing for each layer group whether the whole group is included and which layers are included or excluded individually. |
| [Union](#union) | [IPCB_LayerSet](#) | Returns a new set with the layers that are in this set, in the given set, or in both. |

### Complement

Returns a new set that contains exactly the layers this set does not contain.

```csharp
IPCB_LayerSet Complement();
```

**Returns:** [IPCB_LayerSet](#)

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

### Contains

Returns whether the set contains the given layer.

```csharp
bool Contains(V7_LayerBase argL);
bool Contains(IV7_Layer argL);
```

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

**Returns:** `bool`

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

### ContainsInternalPlaneLayers

Returns true when the set includes the internal plane layers as a group or contains at least one internal plane layer added individually.

```csharp
bool ContainsInternalPlaneLayers();
```

**Returns:** `bool`

### EqualTo

Returns whether this set and the given set contain exactly the same layers.

```csharp
bool EqualTo(IPCB_LayerSet argLayerSet);
bool EqualTo(object argLayerSet);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argLayerSet` | [IPCB_LayerSet](#) | value |

**Returns:** `bool`

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

### EqualTo_1

Returns whether the set contains exactly the layers of the given set of layer values.

```csharp
bool EqualTo_1(TLayerPartitionSet argLayerSet);
bool EqualTo_1(ITransportSet argLayerSet);
```

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

**Returns:** `bool`

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

### Exclude

Removes the given layer from the set and returns the set.

```csharp
IPCB_LayerSet Exclude(V7_LayerBase argL);
```

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

**Returns:** [IPCB_LayerSet](#)

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

### Exclude_1

Removes each layer of the given set of layer values from the set and returns the set.

```csharp
IPCB_LayerSet Exclude_1(TLayerPartitionSet argLayerSet);
```

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

**Returns:** [IPCB_LayerSet](#)

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

### ExcludeAllLayers

*No description yet.*

```csharp
IPCB_LayerSet ExcludeAllLayers();
```

**Returns:** [IPCB_LayerSet](#)

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

### ExcludeInternalPlaneLayers

Removes all internal plane layers from the set, including those added individually, and returns the set.

```csharp
IPCB_LayerSet ExcludeInternalPlaneLayers();
```

**Returns:** [IPCB_LayerSet](#)

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

### ExcludeMechanicalLayers

Removes all mechanical layers from the set, including those added individually, and returns the set.

```csharp
IPCB_LayerSet ExcludeMechanicalLayers();
```

**Returns:** [IPCB_LayerSet](#)

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

### ExcludeSignalLayers

Removes all signal layers from the set, including those added individually, and returns the set.

```csharp
IPCB_LayerSet ExcludeSignalLayers();
```

**Returns:** [IPCB_LayerSet](#)

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

### GetFirstLayer

Returns one layer of the set, or no layer when the set is empty.

```csharp
V7_LayerBase GetFirstLayer();
```

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

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

When [`IsFinite`](#isfinite) is true this is the first layer that [`LayerIterator`](#layeriterator) returns, so for a set that includes a whole layer group with some of its layers excluded the call fails with the same error as [`LayerIterator`](#layeriterator). When [`IsFinite`](#isfinite) is false it is the first of internal plane 1, mechanical layer 1 and the top overlay that the set contains, or the top layer when it contains none of them.

### Include

Adds the given layer to the set and returns the set.

```csharp
IPCB_LayerSet Include(V7_LayerBase argL);
```

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

**Returns:** [IPCB_LayerSet](#)

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

### IncludeAllLayers

Includes the signal, internal plane, mechanical and standard layer groups as a whole and returns the set.

```csharp
IPCB_LayerSet IncludeAllLayers();
```

**Returns:** [IPCB_LayerSet](#)

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

### IncludeInternalPlaneLayers

Adds all internal plane layers to the set and returns the set.

```csharp
IPCB_LayerSet IncludeInternalPlaneLayers();
```

**Returns:** [IPCB_LayerSet](#)

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

Internal plane layers excluded individually before the call are included again.

### IncludeMechanicalLayers

Adds all mechanical layers to the set and returns the set.

```csharp
IPCB_LayerSet IncludeMechanicalLayers();
```

**Returns:** [IPCB_LayerSet](#)

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

Mechanical layers excluded individually before the call are included again.

### IncludeMiscLayers

Adds all standard layers to the set and returns the set; the same as [`IncludeStandardLayers`](#includestandardlayers).

```csharp
IPCB_LayerSet IncludeMiscLayers();
```

**Returns:** [IPCB_LayerSet](#)

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

### IncludeSignalLayers

Adds all signal layers to the set and returns the set.

```csharp
IPCB_LayerSet IncludeSignalLayers();
```

**Returns:** [IPCB_LayerSet](#)

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

Signal layers excluded individually before the call are included again.

### IncludeStandardLayers

Adds all standard layers to the set and returns the set.

```csharp
IPCB_LayerSet IncludeStandardLayers();
```

**Returns:** [IPCB_LayerSet](#)

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

Standard layers excluded individually before the call are included again.

### Intersection

Returns a new set with the layers that are in both this set and the given set.

```csharp
IPCB_LayerSet Intersection(IPCB_LayerSet argLayerSet);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argLayerSet` | [IPCB_LayerSet](#) | value |

**Returns:** [IPCB_LayerSet](#)

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

### IsAllLayers

Returns true when the set includes every layer group (signal, mechanical, internal plane, standard and dielectric layers) as a whole, with no layer excluded.

```csharp
bool IsAllLayers();
```

**Returns:** `bool`

Returns false for a set made with [`IncludeAllLayers`](#includealllayers) or [`IPCB_LayerSetUtils.AllLayers`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#alllayers), which do not include the dielectric layers.

### IsEmpty

Returns true when the set contains no layer.

```csharp
bool IsEmpty();
```

**Returns:** `bool`

### IsFinite

Returns false when the set includes at least one layer group as a whole with no layer excluded from it; otherwise true.

```csharp
bool IsFinite();
```

**Returns:** `bool`

A set that includes a whole group with some of its layers excluded counts as finite, but [`LayerIterator`](#layeriterator) still fails for it.

### LayerIterator

Returns an iterator over the layers of the set.

```csharp
IPCB_LayerIterator LayerIterator();
```

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

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

The call fails with an error when the set includes any layer group as a whole (after [`IncludeSignalLayers`](#includesignallayers), [`IncludeAllLayers`](#includealllayers) and similar), even if layers were excluded from that group afterwards. The iterator returns the signal layers first, then the mechanical, internal plane, standard and dielectric layers.

### Replicate

Returns an independent copy of the set; changing the copy does not change this set.

```csharp
IPCB_LayerSet Replicate();
```

**Returns:** [IPCB_LayerSet](#)

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

### SerializeToString

Returns the set as a string from which [`IPCB_LayerSetUtils.SerializeFromString`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#serializefromstring) creates an equal set.

```csharp
string SerializeToString();
```

**Returns:** `string`

### ToString

Returns a readable description of the set, listing for each layer group whether the whole group is included and which layers are included or excluded individually.

```csharp
string ToString();
```

**Returns:** `string`

### Union

Returns a new set with the layers that are in this set, in the given set, or in both.

```csharp
IPCB_LayerSet Union(IPCB_LayerSet argLayerSet);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argLayerSet` | [IPCB_LayerSet](#) | value |

**Returns:** [IPCB_LayerSet](#)

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

## Returned by

[IPCB_Board.ElectricalLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#electricallayers), [IPCB_Board.MechanicalLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#mechanicallayers), [IPCB_Board.VisibleLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#visiblelayers), [IPCB_BoardLayerSet.GetLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardLayerSet.md#getlayers), [IPCB_Factory.AllLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Factory.md#alllayers), [IPCB_Factory.CreateLayerSet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Factory.md#createlayerset), [IPCB_Factory.CreateLayerSet_1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Factory.md#createlayerset_1), [IPCB_Factory.CreateLayerSet_2](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Factory.md#createlayerset_2), [IPCB_Factory.CreateLayerSet_3](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Factory.md#createlayerset_3), [IPCB_Factory.SignalLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Factory.md#signallayers), [IPCB_GroupComparisionResult.GetTotalLayerSet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_GroupComparisionResult.md#gettotallayerset), [IPCB_LayerSetUtils.AllLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#alllayers), [IPCB_LayerSetUtils.Complement](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#complement), [IPCB_LayerSetUtils.CreateLayerSet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#createlayerset), [IPCB_LayerSetUtils.EmptySet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#emptyset), [IPCB_LayerSetUtils.Factory](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#factory), [IPCB_LayerSetUtils.Factory_1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#factory_1), [IPCB_LayerSetUtils.Factory_2](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#factory_2), [IPCB_LayerSetUtils.Factory_3](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#factory_3), [IPCB_LayerSetUtils.InternalPlaneLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#internalplanelayers), [IPCB_LayerSetUtils.Intersection](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#intersection), [IPCB_LayerSetUtils.MechanicalLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#mechanicallayers), [IPCB_LayerSetUtils.NonEditableLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#noneditablelayers), [IPCB_LayerSetUtils.SerializeFromString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#serializefromstring), [IPCB_LayerSetUtils.SignalLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#signallayers), [IPCB_LayerSetUtils.StandardLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#standardlayers), [IPCB_LayerSetUtils.Union](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#union), [IPCB_Viewport.VisibleLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Viewport.md#visiblelayers), [IPrintedElectronics.GetDielectricalLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPrintedElectronics.md#getdielectricallayers), [IPrintedElectronics.GetDielectricBetweenTwoLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPrintedElectronics.md#getdielectricbetweentwolayers), [IPrintedElectronics.GetElectricalLayers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPrintedElectronics.md#getelectricallayers)

## Accepted by

[IPCB_AbstractIterator.AddFilter_IPCB_LayerSet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_AbstractIterator.md#addfilter_ipcb_layerset), [IPCB_AbstractIterator.AddFilter_LayerSet_1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_AbstractIterator.md#addfilter_layerset_1), [IPCB_BoardLayerSetManager.NewLayerSetV7](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardLayerSetManager.md#newlayersetv7), [IPCB_BoardLayerSetManager.UpdateLayerSetV7](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardLayerSetManager.md#updatelayersetv7), [IPCB_LayerIterator.AddFilter_LayerSet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerIterator.md#addfilter_layerset), [IPCB_LayerSetUtils.AreDisjoint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#aredisjoint), [IPCB_LayerSetUtils.Complement](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#complement), [IPCB_LayerSetUtils.Equal](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#equal), [IPCB_LayerSetUtils.Intersection](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#intersection), [IPCB_LayerSetUtils.SerializeToString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#serializetostring), [IPCB_LayerSetUtils.Union](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md#union), [IPCB_LayerUtils.FirstLayerInRange](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerUtils.md#firstlayerinrange), [IPCB_ManufactruingRuleList.AddManufacturingRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ManufactruingRuleList.md#addmanufacturingrule), [IPCB_MasterLayerStack.GetSubstack_1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MasterLayerStack.md#getsubstack_1), [IPCB_PrimitiveComparator.CompareGroup](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PrimitiveComparator.md#comparegroup)
