
# IPCB_ServerInterface interface

The PCB server, the entry point to PCB documents and PCB libraries and the factory of new PCB objects.

```csharp
public interface IPCB_ServerInterface
```

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

## Remarks

[`PCB.GlobalVars.PCBServer`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/GlobalVars.md#pcbserver) returns it: it is the server module named `PCB` of the client ([`DXP.IClient.GetServerModuleByName`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IClient.md#getservermodulebyname)), so the same object is also a [`DXP.IServerModule`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IServerModule.md). [`PCB.GlobalVars.PCBServer`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/GlobalVars.md#pcbserver) is null when there is no client or the client has no PCB server module.

[`GetCurrentPCBBoard`](#getcurrentpcbboard) returns the board of the document in the current view, and [`GetCurrentPCBLibrary`](#getcurrentpcblibrary) the library of a PCB library document in the current view.

The factory methods create new objects: [`PCBObjectFactory`](#pcbobjectfactory) design objects, [`PCBRuleFactory`](#pcbrulefactory) design rules, [`PCBClassFactory`](#pcbclassfactory) and [`PCBClassFactoryByClassMember`](#pcbclassfactorybyclassmember) object classes, and [`PCBContourFactory`](#pcbcontourfactory) contours. A new design object is not on a board until it is added with [`IPCB_Board.AddPCBObject`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#addpcbobject).

[`PreProcess`](#preprocess) and [`PostProcess`](#postprocess) keep the undo system and the other parts of the PCB editor in step with changes, when you add, remove or modify objects of a PCB or PCB library document.

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [CanFastCrossSelect_Emit](#canfastcrossselect_emit) | `bool` | get; set |  |
| [CanFastCrossSelect_Receive](#canfastcrossselect_receive) | `bool` | get; set |  |
| [InteractiveRoutingOptions](#interactiveroutingoptions) | [IPCB_InteractiveRoutingOptions](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_InteractiveRoutingOptions.md) | get | The interactive routing options of the PCB editor. |
| [PadViaLibraryManager](#padvialibrarymanager) | [IPCB_PadViaLibraryManager](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PadViaLibraryManager.md) | get |  |
| [SpecialStringConverter](#specialstringconverter) | [IPCB_SpecialStringConverter](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SpecialStringConverter.md) | get | The converter of the special strings in PCB text. |
| [SystemOptions](#systemoptions) | [IPCB_SystemOptions](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SystemOptions.md) | get | The system options of the PCB editor, such as its display options. |
| [TTFLettersCache](#ttfletterscache) | [IPCB_LettersCache](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LettersCache.md) | get |  |
| [TTFontsCache](#ttfontscache) | [IPCB_TTFontsCache](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_TTFontsCache.md) | get |  |

### CanFastCrossSelect_Emit

*No description yet.*

```csharp
bool GetState_CanFastCrossSelect_Emit();
void SetState_CanFastCrossSelect_Emit(bool argB);
```

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

Assigning a value has no effect. The value is false while the cross-select mode preference of the workspace is off.

### CanFastCrossSelect_Receive

*No description yet.*

```csharp
bool GetState_CanFastCrossSelect_Receive();
void SetState_CanFastCrossSelect_Receive(bool argB);
```

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

### InteractiveRoutingOptions

The interactive routing options of the PCB editor.

```csharp
IPCB_InteractiveRoutingOptions GetState_InteractiveRoutingOptions();
```

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

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

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

### PadViaLibraryManager

*No description yet.*

```csharp
IPCB_PadViaLibraryManager GetState_PadViaLibraryManager();
```

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

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

### SpecialStringConverter

The converter of the special strings in PCB text.

```csharp
IPCB_SpecialStringConverter GetState_SpecialStringConverter();
```

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

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

The property is read-only, but the properties of the returned object can be changed.

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

### SystemOptions

The system options of the PCB editor, such as its display options.

```csharp
IPCB_SystemOptions GetState_SystemOptions();
```

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

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

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

### TTFLettersCache

*No description yet.*

```csharp
IPCB_LettersCache GetState_TTFLettersCache();
```

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

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

### TTFontsCache

*No description yet.*

```csharp
IPCB_TTFontsCache GetState_TTFontsCache();
```

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

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

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [Board3DModelExporter](#board3dmodelexporter) | [IPCB_Board3DModelExporter](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board3DModelExporter.md) | Creates a new [`IPCB_Board3DModelExporter`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board3DModelExporter.md) object on each call. |
| [CreateComponentPainter](#createcomponentpainter) | [IPCB_ComponentPainterView](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ComponentPainterView.md) |  |
| [CreateDocumentPainter](#createdocumentpainter) | [IPCB_DocumentPainterView](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_DocumentPainterView.md) |  |
| [CreateLayerStackupPainter](#createlayerstackuppainter) | [IPCB_LayerStackupDocumentPainterView](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerStackupDocumentPainterView.md) |  |
| [CreatePCBLibComp](#createpcblibcomp) | [IPCB_LibComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LibComponent.md) | Creates a new footprint (library component) that does not belong to a library. |
| [CreatePCBLibrary](#createpcblibrary) | [IPCB_Library](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Library.md) | Creates a new PCB library that is not open as a document. |
| [CreatePCBWideStringList](#createpcbwidestringlist) | [IPCB_WideStrings](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_WideStrings.md) | Creates a new [`IPCB_WideStrings`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_WideStrings.md) list. |
| [DestroyPCBContour](#destroypcbcontour) | `void` | Releases a contour created with [`PCBContourFactory`](#pcbcontourfactory) and sets the variable to null. |
| [DestroyPCBLibComp](#destroypcblibcomp) | `void` | Frees a footprint (library component) that does not belong to a library. |
| [DestroyPCBLibrary](#destroypcblibrary) | `void` | Frees a PCB library object. |
| [DestroyPCBObject](#destroypcbobject) | `void` | Frees a PCB object created with [`PCBObjectFactory`](#pcbobjectfactory). |
| [DisableFastParams](#disablefastparams) | `void` |  |
| [DocumentLiveHighlight_Start](#documentlivehighlight_start) | `void` |  |
| [DocumentLiveHighlight_Stop](#documentlivehighlight_stop) | `void` |  |
| [EnableFastParams](#enablefastparams) | `void` |  |
| [GetCurrentPCBBoard](#getcurrentpcbboard) | [IPCB_Board](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md) | Returns the board of the document in the current view, a PCB document or a PCB library document. |
| [GetCurrentPCBLibrary](#getcurrentpcblibrary) | [IPCB_Library](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Library.md) | Returns the library of the PCB library document in the current view. |
| [GetOccWrapper](#getoccwrapper) | [IOccWrapper](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IOccWrapper.md) |  |
| [GetParametersFactory](#getparametersfactory) | [IPCB_ParametersFactory](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ParametersFactory.md) |  |
| [GetPCBBoardByBoardID](#getpcbboardbyboardid) | [IPCB_Board](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md) | Returns the board whose [`IPCB_Board.BoardID`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#boardid) has the given value. |
| [GetPCBBoardByPath](#getpcbboardbypath) | [IPCB_Board](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md) | Returns the board of an open PCB or PCB library document by its file name. |
| [GetPCBLibraryByLibraryID](#getpcblibrarybylibraryid) | [IPCB_Library](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Library.md) | Returns the library whose [`IPCB_Library.LibraryID`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Library.md#libraryid) has the given value. |
| [GetPCBLibraryByPath](#getpcblibrarybypath) | [IPCB_Library](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Library.md) | Returns the library of an open PCB library document by its file name. |
| [LayerSet](#layerset) | [IPCB_LayerSetUtils](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md) | Returns the [`IPCB_LayerSetUtils`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md) object. |
| [LayerUtils](#layerutils) | [IPCB_LayerUtils](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerUtils.md) | Returns the [`IPCB_LayerUtils`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerUtils.md) object. |
| [LoadCompFromLibrary](#loadcompfromlibrary) | [IPCB_LibComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LibComponent.md) | Loads a footprint from a PCB library file and returns it as an [`IPCB_LibComponent`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LibComponent.md). |
| [LoadPCBBoardByPath](#loadpcbboardbypath) | [IPCB_Board](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md) | Returns the board of a PCB document by its file name, loading the file when no open document has that name. |
| [LoadPCBLibraryByPath](#loadpcblibrarybypath) | [IPCB_Library](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Library.md) | Returns the library of a PCB library document by its file name, loading the file when no open document has that name. |
| [LoadPCBLibraryFromFile](#loadpcblibraryfromfile) | [IPCB_Library](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Library.md) | Returns the library of the open PCB library document with the given file name, or loads the PCB library file without opening it as a document. |
| [PaintFootprintThumbnail](#paintfootprintthumbnail) | `uint` | Draws a footprint of a PCB library file into a new bitmap and returns the bitmap's handle. |
| [PcbApi_Export_ToPainter](#pcbapi_export_topainter) | `void` |  |
| [PCBClassFactory](#pcbclassfactory) | [IPCB_ObjectClass](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md) | Creates an object class ([`IPCB_ObjectClass`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md)) for the given kind of object. |
| [PCBClassFactoryByClassMember](#pcbclassfactorybyclassmember) | [IPCB_ObjectClass](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md) | Creates an object class ([`IPCB_ObjectClass`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md)) whose members are of the given kind. |
| [PCBContourFactory](#pcbcontourfactory) | [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) | Creates a new, empty contour (with no points). |
| [PCBContourMaker](#pcbcontourmaker) | [IPCB_ContourMaker](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md) | Returns the [`IPCB_ContourMaker`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md) object. |
| [PCBContourUtilities](#pcbcontourutilities) | [IPCB_ContourUtilities](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourUtilities.md) |  |
| [PCBGeometricPolygonFactory](#pcbgeometricpolygonfactory) | [IPCB_GeometricPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_GeometricPolygon.md) | Creates a new, empty geometric polygon. |
| [PCBGeometryMaker](#pcbgeometrymaker) | [IPCB_GeometryMaker](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_GeometryMaker.md) |  |
| [PCBObjectFactory](#pcbobjectfactory) | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | Creates a new PCB design object of the given kind and returns it as an [`IPCB_Primitive`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md). |
| [PCBRuleFactory](#pcbrulefactory) | [IPCB_Rule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Rule.md) | Creates a design rule ([`IPCB_Rule`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Rule.md)) of the given kind. |
| [PostBatchProcess](#postbatchprocess) | `void` | Ends a batch started with [`PreBatchProcess`](#prebatchprocess), like [`PostProcess`](#postprocess). |
| [PostProcess](#postprocess) | `void` | Ends a change to the document of the current view that was started with [`PreProcess`](#preprocess). |
| [PreBatchProcess](#prebatchprocess) | `void` | Starts a batch of changes to the document of the current view, like [`PreProcess`](#preprocess). |
| [PreProcess](#preprocess) | `void` | Starts a change to the document of the current view; end it with [`PostProcess`](#postprocess). |
| [PrimitiveComparator](#primitivecomparator) | [IPCB_PrimitiveComparator](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PrimitiveComparator.md) | Returns the [`IPCB_PrimitiveComparator`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PrimitiveComparator.md) object. |
| [RefreshDocumentView](#refreshdocumentview) | `void` | Refreshes the PCB editor view of an open document. |
| [RunFontEditorDialog](#runfonteditordialog) | `bool` |  |

### Board3DModelExporter

Creates a new [`IPCB_Board3DModelExporter`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board3DModelExporter.md) object on each call.

```csharp
IPCB_Board3DModelExporter Board3DModelExporter();
```

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

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

### CreateComponentPainter

*No description yet.*

```csharp
IPCB_ComponentPainterView CreateComponentPainter();
```

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

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

### CreateDocumentPainter

*No description yet.*

```csharp
IPCB_DocumentPainterView CreateDocumentPainter(TPCB_DocumentPainterMode argMode);
```

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

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

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

### CreateLayerStackupPainter

*No description yet.*

```csharp
IPCB_LayerStackupDocumentPainterView CreateLayerStackupPainter();
```

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

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

### CreatePCBLibComp

Creates a new footprint (library component) that does not belong to a library.

```csharp
IPCB_LibComponent CreatePCBLibComp();
```

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

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

The SDK examples set the new footprint's [`IPCB_LibComponent.Pattern`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LibComponent.md#pattern) and then add it to a library with [`IPCB_Library.RegisterComponent`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Library.md#registercomponent).

**Example:** Create a footprint with one pad in the current PCB library.

```csharp
using PCB;

IPCB_ServerInterface pcbServer = PCB.GlobalVars.PCBServer;
if (pcbServer == null)
    return;
IPCB_Library currentLib = pcbServer.GetCurrentPCBLibrary();
if (currentLib == null)
    return;
IPCB_LibComponent newPCBLibComp = pcbServer.CreatePCBLibComp();
newPCBLibComp.SetState_Pattern("ANewComponent");
currentLib.RegisterComponent(newPCBLibComp);
pcbServer.PreProcess();
var newPad = pcbServer.PCBObjectFactory(TObjectId.ePadObject, TDimensionKind.eNoDimension, TObjectCreationMode.eCreate_Default) as IPCB_Pad;
newPad.SetState_XLocation(EDP.Utils.MilsToCoord(0));
newPad.SetState_YLocation(EDP.Utils.MilsToCoord(0));
newPad.SetState_TopXSize(EDP.Utils.MilsToCoord(62));
newPad.SetState_TopYSize(EDP.Utils.MilsToCoord(62));
newPad.SetState_HoleSize(EDP.Utils.MilsToCoord(28));
newPad.SetState_Layer(TV6_Layer.eV6_MultiLayer);
newPad.SetState_Name("1");
newPCBLibComp.AddPCBObject(newPad);
pcbServer.PostProcess();
currentLib.SetState_CurrentComponent(newPCBLibComp);
currentLib.GetState_Board().ViewManager_FullUpdate();
```

**See also:** [IPCB_LibComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LibComponent.md), [IPCB_ServerInterface.DestroyPCBLibComp](#destroypcblibcomp)

**Examples:** [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L46)

### CreatePCBLibrary

Creates a new PCB library that is not open as a document.

```csharp
IPCB_Library CreatePCBLibrary();
```

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

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

**See also:** [IPCB_ServerInterface.DestroyPCBLibrary](#destroypcblibrary)

### CreatePCBWideStringList

Creates a new [`IPCB_WideStrings`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_WideStrings.md) list.

```csharp
IPCB_WideStrings CreatePCBWideStringList();
```

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

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

### DestroyPCBContour

Releases a contour created with [`PCBContourFactory`](#pcbcontourfactory) and sets the variable to null.

```csharp
void DestroyPCBContour(ref IPCB_Contour argPCBContour);
void DestroyPCBContour(ref object argPCBContour);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argPCBContour` | [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) | ref |

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

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

**See also:** [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md), [IPCB_ServerInterface.PCBContourFactory](#pcbcontourfactory)

### DestroyPCBLibComp

Frees a footprint (library component) that does not belong to a library.

```csharp
void DestroyPCBLibComp(ref IPCB_LibComponent argPCBLibComp);
void DestroyPCBLibComp(ref object argPCBLibComp);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPCBLibComp` | [IPCB_LibComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LibComponent.md) | ref | The footprint to free. It is set to null when the footprint is freed; nothing happens when it is null. |

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

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

Does nothing for a footprint that belongs to a library; the variable keeps its value. A library is composed of footprints, each represented by an [`IPCB_LibComponent`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LibComponent.md).

**See also:** [IPCB_ServerInterface.CreatePCBLibComp](#createpcblibcomp)

### DestroyPCBLibrary

Frees a PCB library object.

```csharp
void DestroyPCBLibrary(ref IPCB_Library argPCBLibrary);
void DestroyPCBLibrary(ref object argPCBLibrary);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPCBLibrary` | [IPCB_Library](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Library.md) | ref | The library to free. It is set to null; nothing happens when it is already null. |

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

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

**See also:** [IPCB_ServerInterface.CreatePCBLibrary](#createpcblibrary)

### DestroyPCBObject

Frees a PCB object created with [`PCBObjectFactory`](#pcbobjectfactory).

```csharp
void DestroyPCBObject(ref IPCB_Primitive argPCBObject);
void DestroyPCBObject(ref object argPCBObject);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPCBObject` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | ref | The object to free. It is set to null; nothing happens when it is already null. |

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

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

**See also:** [IPCB_ServerInterface.PCBObjectFactory](#pcbobjectfactory)

### DisableFastParams

*No description yet.*

```csharp
void DisableFastParams();
```

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

### DocumentLiveHighlight_Start

*No description yet.*

```csharp
void DocumentLiveHighlight_Start(string argDocumentPath);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argDocumentPath` | `string` | value | The file name of an open PCB or PCB library document. |

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

Does nothing when no open PCB or PCB library document has the given file name.

### DocumentLiveHighlight_Stop

*No description yet.*

```csharp
void DocumentLiveHighlight_Stop(string argDocumentPath);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argDocumentPath` | `string` | value | The file name of an open PCB or PCB library document. |

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

Does nothing when no open PCB or PCB library document has the given file name.

### EnableFastParams

*No description yet.*

```csharp
void EnableFastParams();
```

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

### GetCurrentPCBBoard

Returns the board of the document in the current view, a PCB document or a PCB library document.

```csharp
IPCB_Board GetCurrentPCBBoard();
```

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

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

Returns null when there is no current view or the document of the current view is not a PCB or PCB library document. The result depends on the current view: check it for null before use.

**Examples:** [Extension_BOMManager](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_BOMManager/Source%20Code/Commands.cs#L34), [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L86), [Extension_InternalPlaneLayer](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_InternalPlaneLayer/Source%20Code/Commands.cs#L29), [Extension_PCBToImage](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PCBToImage/Source%20Code/Commands.cs#L94), [Extension_PCBUndoRedo](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PCBUndoRedo/Source%20Code/Commands.cs#L33), [Extension_Pad_SolderMask](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_Pad_SolderMask/Source%20Code/Commands.cs#L28), [Extension_PcbLibComponentToSTEP](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PcbLibComponentToSTEP/Source%20Code/Commands.cs#L29), [Extension_PlaceAndMovePcbComponent](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PlaceAndMovePcbComponent/Source%20Code/Commands.cs#L28), [Extension_PlacePad](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PlacePad/Source%20Code/Commands.cs#L26)

### GetCurrentPCBLibrary

Returns the library of the PCB library document in the current view.

```csharp
IPCB_Library GetCurrentPCBLibrary();
```

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

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

Returns null when there is no current view or the document of the current view is not a PCB library document.

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

**Examples:** [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L39), [Extension_PcbLibToImage](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PcbLibToImage/Source%20Code/Commands.cs#L39)

### GetOccWrapper

*No description yet.*

```csharp
IOccWrapper GetOccWrapper();
```

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

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

### GetParametersFactory

*No description yet.*

```csharp
IPCB_ParametersFactory GetParametersFactory();
```

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

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

### GetPCBBoardByBoardID

Returns the board whose [`IPCB_Board.BoardID`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#boardid) has the given value.

```csharp
IPCB_Board GetPCBBoardByBoardID(int argBoardID);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argBoardID` | `int` | value |

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

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

Returns null for 0 and when no board has that ID.

### GetPCBBoardByPath

Returns the board of an open PCB or PCB library document by its file name.

```csharp
IPCB_Board GetPCBBoardByPath(string argPath);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPath` | `string` | value | The file name of the open document. |

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

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

Returns null when no open PCB or PCB library document has that file name.

### GetPCBLibraryByLibraryID

Returns the library whose [`IPCB_Library.LibraryID`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Library.md#libraryid) has the given value.

```csharp
IPCB_Library GetPCBLibraryByLibraryID(int argLibraryID);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argLibraryID` | `int` | value |

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

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

Returns null for 0 and when no library has that ID.

### GetPCBLibraryByPath

Returns the library of an open PCB library document by its file name.

```csharp
IPCB_Library GetPCBLibraryByPath(string argPath);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPath` | `string` | value | The file name of the open document. |

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

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

Returns null when no open document has that file name, or when that document is not a PCB library document.

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

### LayerSet

Returns the [`IPCB_LayerSetUtils`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerSetUtils.md) object.

```csharp
IPCB_LayerSetUtils LayerSet();
```

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

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

Every call returns the same object.

### LayerUtils

Returns the [`IPCB_LayerUtils`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerUtils.md) object.

```csharp
IPCB_LayerUtils LayerUtils();
```

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

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

Every call returns the same object.

### LoadCompFromLibrary

Loads a footprint from a PCB library file and returns it as an [`IPCB_LibComponent`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LibComponent.md).

```csharp
IPCB_LibComponent LoadCompFromLibrary(string argPattern, string argLibPath);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPattern` | `string` | value | The name of the footprint. |
| `argLibPath` | `string` | value | The path of the PCB library file. |

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

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

The returned footprint is not on any board.

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

### LoadPCBBoardByPath

Returns the board of a PCB document by its file name, loading the file when no open document has that name.

```csharp
IPCB_Board LoadPCBBoardByPath(string argPath);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPath` | `string` | value | The file name of the PCB document. |

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

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

For an open document it returns that document's board. Otherwise a PCB file in the current file format is loaded into a new board without opening it as a document, and a file in another format is opened as a document in Altium Designer.

### LoadPCBLibraryByPath

Returns the library of a PCB library document by its file name, loading the file when no open document has that name.

```csharp
IPCB_Library LoadPCBLibraryByPath(string argPath);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPath` | `string` | value | The file name of the PCB library document. |

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

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

For an open document it returns that document's library, or null when the document is not a PCB library document. Otherwise a PCB library file in the current file format is loaded into a new library without opening it as a document, and a file in another format is opened as a document in Altium Designer.

**Examples:** [Extension_PcbLibComponentToSTEP](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PcbLibComponentToSTEP/Source%20Code/Commands.cs#L33)

### LoadPCBLibraryFromFile

Returns the library of the open PCB library document with the given file name, or loads the PCB library file without opening it as a document.

```csharp
IPCB_Library LoadPCBLibraryFromFile(string argPath);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argPath` | `string` | value | The full path of the PCB library file. |

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

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

Returns null when the file does not exist or is not a recognised PCB library file.

### PaintFootprintThumbnail

Draws a footprint of a PCB library file into a new bitmap and returns the bitmap's handle.

```csharp
uint PaintFootprintThumbnail(string argViewName, string argViewFileAddress, int argWidth, int argHeight);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argViewName` | `string` | value | The name of the footprint. |
| `argViewFileAddress` | `string` | value | The path of the PCB library file. |
| `argWidth` | `int` | value | The width of the bitmap, in pixels. |
| `argHeight` | `int` | value | The height of the bitmap, in pixels. |

**Returns:** `uint`

The footprint is scaled to fit the bitmap and drawn with its pad numbers; text objects and objects on paste mask and solder mask layers are left out. Returns 0 when the footprint cannot be loaded from the file.

**Examples:** [Extension_PcbLibToImage](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PcbLibToImage/Source%20Code/Commands.cs#L58)

### PcbApi_Export_ToPainter

*No description yet.*

```csharp
void PcbApi_Export_ToPainter(ref object argPainter, string argLibReference, string argLibraryPath);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argPainter` | `object` | ref |
| `argLibReference` | `string` | value |
| `argLibraryPath` | `string` | value |

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

### PCBClassFactory

Creates an object class ([`IPCB_ObjectClass`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md)) for the given kind of object.

```csharp
IPCB_ObjectClass PCBClassFactory(TObjectId argClassKind);
```

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

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

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

An object class is a named group of design objects that design rules can target. Classes can be created for `TObjectId.eNetObject`, `TObjectId.eComponentObject`, `TObjectId.eFromToObject`, `TObjectId.ePadObject`, `TObjectId.ePolyObject`, `TObjectId.eSplitPlaneObject` and `TObjectId.eClassObject` (a class of classes); for any other kind the method returns null.

**See also:** [IPCB_ServerInterface.PCBClassFactoryByClassMember](#pcbclassfactorybyclassmember)

### PCBClassFactoryByClassMember

Creates an object class ([`IPCB_ObjectClass`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md)) whose members are of the given kind.

```csharp
IPCB_ObjectClass PCBClassFactoryByClassMember(TClassMemberKind argClassKind);
```

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

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

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

An object class is a named group of design objects that design rules can target. Unlike [`PCBClassFactory`](#pcbclassfactory), every [`TClassMemberKind`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TClassMemberKind.md) value creates a class, for example `TClassMemberKind.eClassMemberKind_Layer` or `TClassMemberKind.eClassMemberKind_DifferentialPair`.

**See also:** [IPCB_ServerInterface.PCBClassFactory](#pcbclassfactory)

### PCBContourFactory

Creates a new, empty contour (with no points).

```csharp
IPCB_Contour PCBContourFactory();
```

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

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

**See also:** [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md), [IPCB_ServerInterface.DestroyPCBContour](#destroypcbcontour)

### PCBContourMaker

Returns the [`IPCB_ContourMaker`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md) object.

```csharp
IPCB_ContourMaker PCBContourMaker();
```

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

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

Every call returns the same object.

### PCBContourUtilities

*No description yet.*

```csharp
IPCB_ContourUtilities PCBContourUtilities();
```

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

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

### PCBGeometricPolygonFactory

Creates a new, empty geometric polygon.

```csharp
IPCB_GeometricPolygon PCBGeometricPolygonFactory();
```

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

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

### PCBGeometryMaker

*No description yet.*

```csharp
IPCB_GeometryMaker PCBGeometryMaker();
```

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

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

### PCBObjectFactory

Creates a new PCB design object of the given kind and returns it as an [`IPCB_Primitive`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md).

```csharp
IPCB_Primitive PCBObjectFactory(TObjectId argObjectId, TDimensionKind argDimensionKind, TObjectCreationMode argCreationMode);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argObjectId` | [TObjectId](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TObjectId.md) | value | The kind of object to create, for example `TObjectId.eTrackObject` or `TObjectId.eViaObject`. |
| `argDimensionKind` | [TDimensionKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TDimensionKind.md) | value | The kind of dimension to create when `argObjectId` is `TObjectId.eDimensionObject`; ignored for other kinds. Pass `TDimensionKind.eNoDimension` for them. |
| `argCreationMode` | [TObjectCreationMode](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TObjectCreationMode.md) | value | `TObjectCreationMode.eCreate_Default` and `TObjectCreationMode.eCreate_GlobalCopy` create the same object with the same initial values. |

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

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

The new object is not on any board: set its properties, then add it to a board with [`IPCB_Board.AddPCBObject`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#addpcbobject). Returns null for a kind that cannot be created this way, such as `TObjectId.eRuleObject` (use [`PCBRuleFactory`](#pcbrulefactory)) or `TObjectId.eClassObject` (use [`PCBClassFactory`](#pcbclassfactory)), and for `TObjectId.eDimensionObject` with `TDimensionKind.eNoDimension`.

**Example:** Create a via and put it on the current board.

```csharp
using PCB;

IPCB_ServerInterface pcbServer = PCB.GlobalVars.PCBServer;
IPCB_Board board = pcbServer?.GetCurrentPCBBoard();
if (board == null)
    return;
// Create a Via object
var via = pcbServer.PCBObjectFactory(TObjectId.eViaObject, TDimensionKind.eNoDimension, TObjectCreationMode.eCreate_Default) as IPCB_Via;
via.SetState_XLocation(EDP.Utils.MilsToCoord(7500));
via.SetState_YLocation(EDP.Utils.MilsToCoord(7500));
via.SetState_Size(EDP.Utils.MilsToCoord(50));
via.SetState_HoleSize(EDP.Utils.MilsToCoord(20));
via.SetState_LowLayer(new V7_Layer(TV6_Layer.eV6_TopLayer));
via.SetState_HighLayer(new V7_Layer(TV6_Layer.eV6_BottomLayer));
// Put the new Via object in the board object
board.AddPCBObject(via);
// Refresh the PCB screen
DXP.Utils.RunCommand("PCB:Zoom", "Action=Redraw");
```

**See also:** [IPCB_ServerInterface.DestroyPCBObject](#destroypcbobject)

**Examples:** [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L90), [Extension_PcbLibComponentToSTEP](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PcbLibComponentToSTEP/Source%20Code/Commands.cs#L43), [Extension_PlaceAndMovePcbComponent](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PlaceAndMovePcbComponent/Source%20Code/Commands.cs#L34), [Extension_PlacePad](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PlacePad/Source%20Code/PlacePadCommand.cs#L38)

### PCBRuleFactory

Creates a design rule ([`IPCB_Rule`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Rule.md)) of the given kind.

```csharp
IPCB_Rule PCBRuleFactory(TRuleKind argRuleKind);
```

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

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

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

Returns null for `TRuleKind.eRule_LayerStack` and `TRuleKind.eRule_None`. A new rule has an empty name and comment, and its scopes ([`IPCB_Rule.Scope1Expression`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Rule.md#scope1expression), [`IPCB_Rule.Scope2Expression`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Rule.md#scope2expression)) are `All`, except for kinds that start with other scopes; for example, both scopes of a new confinement rule are `False`. Add the rule to a board with [`IPCB_Board.AddPCBObject`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#addpcbobject).

### PostBatchProcess

Ends a batch started with [`PreBatchProcess`](#prebatchprocess), like [`PostProcess`](#postprocess).

```csharp
void PostBatchProcess();
```

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

Does nothing when no batch is open or the current view is not a PCB or PCB library document.

**See also:** [IPCB_ServerInterface.PreBatchProcess](#prebatchprocess)

### PostProcess

Ends a change to the document of the current view that was started with [`PreProcess`](#preprocess).

```csharp
void PostProcess();
```

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

Does nothing when the current view is not a PCB or PCB library document. Pairs of [`PreProcess`](#preprocess) and `PostProcess` can nest; when the outermost `PostProcess` returns, the board's views are updated.

**Example:** Move the first selected fill on the current board to the bottom layer.

```csharp
using PCB;

IPCB_ServerInterface pcbServer = PCB.GlobalVars.PCBServer;
IPCB_Board board = pcbServer?.GetCurrentPCBBoard();
if (board == null || board.GetState_SelectecObjectCount() == 0)
    return;
var fill = board.GetState_SelectecObject(0) as IPCB_Fill;
if (fill == null)
    return;

pcbServer.PreProcess();
//Notify PCB that the fill object is going to be changed.
fill.BeginModify();
fill.SetState_Layer(TV6_Layer.eV6_BottomLayer);
//Notify PCB that the fill object has been changed.
fill.EndModify();
pcbServer.PostProcess();
```

**See also:** [IPCB_ServerInterface.PreProcess](#preprocess)

**Examples:** [Extension_PlacePad](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PlacePad/Source%20Code/PlacePadCommand.cs#L64)

### PreBatchProcess

Starts a batch of changes to the document of the current view, like [`PreProcess`](#preprocess).

```csharp
void PreBatchProcess();
```

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

Until [`PostBatchProcess`](#postbatchprocess), calls to [`PreProcess`](#preprocess) and [`PostProcess`](#postprocess) do nothing. Does nothing when a batch is already open or the current view is not a PCB or PCB library document.

**See also:** [IPCB_ServerInterface.PostBatchProcess](#postbatchprocess)

### PreProcess

Starts a change to the document of the current view; end it with [`PostProcess`](#postprocess).

```csharp
void PreProcess();
```

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

Call it before adding, removing or modifying objects, so that the undo system and the other parts of the PCB editor follow the changes. Does nothing when the current view is not a PCB or PCB library document. Pairs of `PreProcess` and [`PostProcess`](#postprocess) can nest.

**See also:** [IPCB_ServerInterface.PostProcess](#postprocess)

**Examples:** [Extension_PlacePad](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PlacePad/Source%20Code/PlacePadCommand.cs#L35)

### PrimitiveComparator

Returns the [`IPCB_PrimitiveComparator`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PrimitiveComparator.md) object.

```csharp
IPCB_PrimitiveComparator PrimitiveComparator();
```

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

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

Every call returns the same object.

### RefreshDocumentView

Refreshes the PCB editor view of an open document.

```csharp
void RefreshDocumentView(string argDocumentPath);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argDocumentPath` | `string` | value | The file name of the open document. |

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

Does nothing when no open document has the given file name.

### RunFontEditorDialog

*No description yet.*

```csharp
bool RunFontEditorDialog(ref int argTextHeight, ref bool argUseTTFont, ref string argStrokeFontName, ref int argStrokeWidth, ref string argTTFontName, ref bool argTTBold, ref bool argTTItalic, ref bool argTTInverted, ref int argTTInvertedBorder);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argTextHeight` | `int` | ref |
| `argUseTTFont` | `bool` | ref |
| `argStrokeFontName` | `string` | ref |
| `argStrokeWidth` | `int` | ref |
| `argTTFontName` | `string` | ref |
| `argTTBold` | `bool` | ref |
| `argTTItalic` | `bool` | ref |
| `argTTInverted` | `bool` | ref |
| `argTTInvertedBorder` | `int` | ref |

**Returns:** `bool`

## Returned by

[GlobalVars.PCBServer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/GlobalVars.md#pcbserver)

## Examples

Used in the SDK examples: [Extension_BOMManager](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_BOMManager/Source%20Code/Commands.cs#L30), [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L35), [Extension_InternalPlaneLayer](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_InternalPlaneLayer/Source%20Code/Commands.cs#L25), [Extension_PCBUndoRedo](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_PCBUndoRedo/Source%20Code/Commands.cs#L29), [Extension_Pad_SolderMask](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_Pad_SolderMask/Source%20Code/Commands.cs#L24).
