Skip to main content
View as Markdown

IPCB_ServerInterface interface

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

public interface IPCB_ServerInterface

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Remarks​

PCB.GlobalVars.PCBServer returns it: it is the server module named PCB of the client (DXP.IClient.GetServerModuleByName), so the same object is also a DXP.IServerModule. PCB.GlobalVars.PCBServer is null when there is no client or the client has no PCB server module.

GetCurrentPCBBoard returns the board of the document in the current view, and GetCurrentPCBLibrary the library of a PCB library document in the current view.

The factory methods create new objects: PCBObjectFactory design objects, PCBRuleFactory design rules, PCBClassFactory and PCBClassFactoryByClassMember object classes, and PCBContourFactory contours. A new design object is not on a board until it is added with IPCB_Board.AddPCBObject.

PreProcess and 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​

PropertyTypeAccessDescription
CanFastCrossSelect_Emitboolget; set
CanFastCrossSelect_Receiveboolget; set
InteractiveRoutingOptionsIPCB_InteractiveRoutingOptionsgetThe interactive routing options of the PCB editor.
PadViaLibraryManagerIPCB_PadViaLibraryManagerget
SpecialStringConverterIPCB_SpecialStringConvertergetThe converter of the special strings in PCB text.
SystemOptionsIPCB_SystemOptionsgetThe system options of the PCB editor, such as its display options.
TTFLettersCacheIPCB_LettersCacheget
TTFontsCacheIPCB_TTFontsCacheget

CanFastCrossSelect_Emit​

No description yet.

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.

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

Type: bool · Access: read/write

InteractiveRoutingOptions​

The interactive routing options of the PCB editor.

IPCB_InteractiveRoutingOptions GetState_InteractiveRoutingOptions();

Type: IPCB_InteractiveRoutingOptions · Access: read-only

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

See also: IPCB_InteractiveRoutingOptions

PadViaLibraryManager​

No description yet.

IPCB_PadViaLibraryManager GetState_PadViaLibraryManager();

Type: IPCB_PadViaLibraryManager · Access: read-only

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

SpecialStringConverter​

The converter of the special strings in PCB text.

IPCB_SpecialStringConverter GetState_SpecialStringConverter();

Type: IPCB_SpecialStringConverter · 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

SystemOptions​

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

IPCB_SystemOptions GetState_SystemOptions();

Type: IPCB_SystemOptions · Access: read-only

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

See also: IPCB_SystemOptions

TTFLettersCache​

No description yet.

IPCB_LettersCache GetState_TTFLettersCache();

Type: IPCB_LettersCache · Access: read-only

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

TTFontsCache​

No description yet.

IPCB_TTFontsCache GetState_TTFontsCache();

Type: IPCB_TTFontsCache · Access: read-only

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

Methods​

MethodReturnsDescription
Board3DModelExporterIPCB_Board3DModelExporterCreates a new IPCB_Board3DModelExporter object on each call.
CreateComponentPainterIPCB_ComponentPainterView
CreateDocumentPainterIPCB_DocumentPainterView
CreateLayerStackupPainterIPCB_LayerStackupDocumentPainterView
CreatePCBLibCompIPCB_LibComponentCreates a new footprint (library component) that does not belong to a library.
CreatePCBLibraryIPCB_LibraryCreates a new PCB library that is not open as a document.
CreatePCBWideStringListIPCB_WideStringsCreates a new IPCB_WideStrings list.
DestroyPCBContourvoidReleases a contour created with PCBContourFactory and sets the variable to null.
DestroyPCBLibCompvoidFrees a footprint (library component) that does not belong to a library.
DestroyPCBLibraryvoidFrees a PCB library object.
DestroyPCBObjectvoidFrees a PCB object created with PCBObjectFactory.
DisableFastParamsvoid
DocumentLiveHighlight_Startvoid
DocumentLiveHighlight_Stopvoid
EnableFastParamsvoid
GetCurrentPCBBoardIPCB_BoardReturns the board of the document in the current view, a PCB document or a PCB library document.
GetCurrentPCBLibraryIPCB_LibraryReturns the library of the PCB library document in the current view.
GetOccWrapperIOccWrapper
GetParametersFactoryIPCB_ParametersFactory
GetPCBBoardByBoardIDIPCB_BoardReturns the board whose IPCB_Board.BoardID has the given value.
GetPCBBoardByPathIPCB_BoardReturns the board of an open PCB or PCB library document by its file name.
GetPCBLibraryByLibraryIDIPCB_LibraryReturns the library whose IPCB_Library.LibraryID has the given value.
GetPCBLibraryByPathIPCB_LibraryReturns the library of an open PCB library document by its file name.
LayerSetIPCB_LayerSetUtilsReturns the IPCB_LayerSetUtils object.
LayerUtilsIPCB_LayerUtilsReturns the IPCB_LayerUtils object.
LoadCompFromLibraryIPCB_LibComponentLoads a footprint from a PCB library file and returns it as an IPCB_LibComponent.
LoadPCBBoardByPathIPCB_BoardReturns the board of a PCB document by its file name, loading the file when no open document has that name.
LoadPCBLibraryByPathIPCB_LibraryReturns the library of a PCB library document by its file name, loading the file when no open document has that name.
LoadPCBLibraryFromFileIPCB_LibraryReturns 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.
PaintFootprintThumbnailuintDraws a footprint of a PCB library file into a new bitmap and returns the bitmap's handle.
PcbApi_Export_ToPaintervoid
PCBClassFactoryIPCB_ObjectClassCreates an object class (IPCB_ObjectClass) for the given kind of object.
PCBClassFactoryByClassMemberIPCB_ObjectClassCreates an object class (IPCB_ObjectClass) whose members are of the given kind.
PCBContourFactoryIPCB_ContourCreates a new, empty contour (with no points).
PCBContourMakerIPCB_ContourMakerReturns the IPCB_ContourMaker object.
PCBContourUtilitiesIPCB_ContourUtilities
PCBGeometricPolygonFactoryIPCB_GeometricPolygonCreates a new, empty geometric polygon.
PCBGeometryMakerIPCB_GeometryMaker
PCBObjectFactoryIPCB_PrimitiveCreates a new PCB design object of the given kind and returns it as an IPCB_Primitive.
PCBRuleFactoryIPCB_RuleCreates a design rule (IPCB_Rule) of the given kind.
PostBatchProcessvoidEnds a batch started with PreBatchProcess, like PostProcess.
PostProcessvoidEnds a change to the document of the current view that was started with PreProcess.
PreBatchProcessvoidStarts a batch of changes to the document of the current view, like PreProcess.
PreProcessvoidStarts a change to the document of the current view; end it with PostProcess.
PrimitiveComparatorIPCB_PrimitiveComparatorReturns the IPCB_PrimitiveComparator object.
RefreshDocumentViewvoidRefreshes the PCB editor view of an open document.
RunFontEditorDialogbool

Board3DModelExporter​

Creates a new IPCB_Board3DModelExporter object on each call.

IPCB_Board3DModelExporter Board3DModelExporter();

Returns: IPCB_Board3DModelExporter

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

CreateComponentPainter​

No description yet.

IPCB_ComponentPainterView CreateComponentPainter();

Returns: IPCB_ComponentPainterView

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

CreateDocumentPainter​

No description yet.

IPCB_DocumentPainterView CreateDocumentPainter(TPCB_DocumentPainterMode argMode);
ParameterTypePassing
argModeTPCB_DocumentPainterModevalue

Returns: IPCB_DocumentPainterView

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

CreateLayerStackupPainter​

No description yet.

IPCB_LayerStackupDocumentPainterView CreateLayerStackupPainter();

Returns: IPCB_LayerStackupDocumentPainterView

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

CreatePCBLibComp​

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

IPCB_LibComponent CreatePCBLibComp();

Returns: IPCB_LibComponent

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

The SDK examples set the new footprint's IPCB_LibComponent.Pattern and then add it to a library with IPCB_Library.RegisterComponent.

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

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, IPCB_ServerInterface.DestroyPCBLibComp

Examples: Extension_CreatePCBLib

CreatePCBLibrary​

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

IPCB_Library CreatePCBLibrary();

Returns: IPCB_Library

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

See also: IPCB_ServerInterface.DestroyPCBLibrary

CreatePCBWideStringList​

Creates a new IPCB_WideStrings list.

IPCB_WideStrings CreatePCBWideStringList();

Returns: IPCB_WideStrings

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

DestroyPCBContour​

Releases a contour created with PCBContourFactory and sets the variable to null.

void DestroyPCBContour(ref IPCB_Contour argPCBContour);
void DestroyPCBContour(ref object argPCBContour);
ParameterTypePassing
argPCBContourIPCB_Contourref

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, IPCB_ServerInterface.PCBContourFactory

DestroyPCBLibComp​

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

void DestroyPCBLibComp(ref IPCB_LibComponent argPCBLibComp);
void DestroyPCBLibComp(ref object argPCBLibComp);
ParameterTypePassingDescription
argPCBLibCompIPCB_LibComponentrefThe 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.

See also: IPCB_ServerInterface.CreatePCBLibComp

DestroyPCBLibrary​

Frees a PCB library object.

void DestroyPCBLibrary(ref IPCB_Library argPCBLibrary);
void DestroyPCBLibrary(ref object argPCBLibrary);
ParameterTypePassingDescription
argPCBLibraryIPCB_LibraryrefThe 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

DestroyPCBObject​

Frees a PCB object created with PCBObjectFactory.

void DestroyPCBObject(ref IPCB_Primitive argPCBObject);
void DestroyPCBObject(ref object argPCBObject);
ParameterTypePassingDescription
argPCBObjectIPCB_PrimitiverefThe 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

DisableFastParams​

No description yet.

void DisableFastParams();

Returns: nothing (void)

DocumentLiveHighlight_Start​

No description yet.

void DocumentLiveHighlight_Start(string argDocumentPath);
ParameterTypePassingDescription
argDocumentPathstringvalueThe 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.

void DocumentLiveHighlight_Stop(string argDocumentPath);
ParameterTypePassingDescription
argDocumentPathstringvalueThe 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.

void EnableFastParams();

Returns: nothing (void)

GetCurrentPCBBoard​

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

IPCB_Board GetCurrentPCBBoard();

Returns: IPCB_Board

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, Extension_CreatePCBLib, Extension_InternalPlaneLayer, Extension_PCBToImage, Extension_PCBUndoRedo, Extension_Pad_SolderMask, Extension_PcbLibComponentToSTEP, Extension_PlaceAndMovePcbComponent, Extension_PlacePad

GetCurrentPCBLibrary​

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

IPCB_Library GetCurrentPCBLibrary();

Returns: IPCB_Library

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

Examples: Extension_CreatePCBLib, Extension_PcbLibToImage

GetOccWrapper​

No description yet.

IOccWrapper GetOccWrapper();

Returns: IOccWrapper

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

GetParametersFactory​

No description yet.

IPCB_ParametersFactory GetParametersFactory();

Returns: IPCB_ParametersFactory

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

GetPCBBoardByBoardID​

Returns the board whose IPCB_Board.BoardID has the given value.

IPCB_Board GetPCBBoardByBoardID(int argBoardID);
ParameterTypePassing
argBoardIDintvalue

Returns: IPCB_Board

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.

IPCB_Board GetPCBBoardByPath(string argPath);
ParameterTypePassingDescription
argPathstringvalueThe file name of the open document.

Returns: IPCB_Board

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 has the given value.

IPCB_Library GetPCBLibraryByLibraryID(int argLibraryID);
ParameterTypePassing
argLibraryIDintvalue

Returns: IPCB_Library

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.

IPCB_Library GetPCBLibraryByPath(string argPath);
ParameterTypePassingDescription
argPathstringvalueThe file name of the open document.

Returns: IPCB_Library

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

LayerSet​

Returns the IPCB_LayerSetUtils object.

IPCB_LayerSetUtils LayerSet();

Returns: IPCB_LayerSetUtils

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

Every call returns the same object.

LayerUtils​

Returns the IPCB_LayerUtils object.

IPCB_LayerUtils LayerUtils();

Returns: IPCB_LayerUtils

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.

IPCB_LibComponent LoadCompFromLibrary(string argPattern, string argLibPath);
ParameterTypePassingDescription
argPatternstringvalueThe name of the footprint.
argLibPathstringvalueThe path of the PCB library file.

Returns: IPCB_LibComponent

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

The returned footprint is not on any board.

See also: IPCB_LibComponent

LoadPCBBoardByPath​

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

IPCB_Board LoadPCBBoardByPath(string argPath);
ParameterTypePassingDescription
argPathstringvalueThe file name of the PCB document.

Returns: IPCB_Board

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.

IPCB_Library LoadPCBLibraryByPath(string argPath);
ParameterTypePassingDescription
argPathstringvalueThe file name of the PCB library document.

Returns: IPCB_Library

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

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.

IPCB_Library LoadPCBLibraryFromFile(string argPath);
ParameterTypePassingDescription
argPathstringvalueThe full path of the PCB library file.

Returns: IPCB_Library

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.

uint PaintFootprintThumbnail(string argViewName, string argViewFileAddress, int argWidth, int argHeight);
ParameterTypePassingDescription
argViewNamestringvalueThe name of the footprint.
argViewFileAddressstringvalueThe path of the PCB library file.
argWidthintvalueThe width of the bitmap, in pixels.
argHeightintvalueThe 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

PcbApi_Export_ToPainter​

No description yet.

void PcbApi_Export_ToPainter(ref object argPainter, string argLibReference, string argLibraryPath);
ParameterTypePassing
argPainterobjectref
argLibReferencestringvalue
argLibraryPathstringvalue

Returns: nothing (void)

PCBClassFactory​

Creates an object class (IPCB_ObjectClass) for the given kind of object.

IPCB_ObjectClass PCBClassFactory(TObjectId argClassKind);
ParameterTypePassing
argClassKindTObjectIdvalue

Returns: IPCB_ObjectClass

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​

Creates an object class (IPCB_ObjectClass) whose members are of the given kind.

IPCB_ObjectClass PCBClassFactoryByClassMember(TClassMemberKind argClassKind);
ParameterTypePassing
argClassKindTClassMemberKindvalue

Returns: IPCB_ObjectClass

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

An object class is a named group of design objects that design rules can target. Unlike PCBClassFactory, every TClassMemberKind value creates a class, for example TClassMemberKind.eClassMemberKind_Layer or TClassMemberKind.eClassMemberKind_DifferentialPair.

See also: IPCB_ServerInterface.PCBClassFactory

PCBContourFactory​

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

IPCB_Contour PCBContourFactory();

Returns: IPCB_Contour

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

See also: IPCB_Contour, IPCB_ServerInterface.DestroyPCBContour

PCBContourMaker​

Returns the IPCB_ContourMaker object.

IPCB_ContourMaker PCBContourMaker();

Returns: IPCB_ContourMaker

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

Every call returns the same object.

PCBContourUtilities​

No description yet.

IPCB_ContourUtilities PCBContourUtilities();

Returns: IPCB_ContourUtilities

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

PCBGeometricPolygonFactory​

Creates a new, empty geometric polygon.

IPCB_GeometricPolygon PCBGeometricPolygonFactory();

Returns: IPCB_GeometricPolygon

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

PCBGeometryMaker​

No description yet.

IPCB_GeometryMaker PCBGeometryMaker();

Returns: IPCB_GeometryMaker

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.

IPCB_Primitive PCBObjectFactory(TObjectId argObjectId, TDimensionKind argDimensionKind, TObjectCreationMode argCreationMode);
ParameterTypePassingDescription
argObjectIdTObjectIdvalueThe kind of object to create, for example TObjectId.eTrackObject or TObjectId.eViaObject.
argDimensionKindTDimensionKindvalueThe kind of dimension to create when argObjectId is TObjectId.eDimensionObject; ignored for other kinds. Pass TDimensionKind.eNoDimension for them.
argCreationModeTObjectCreationModevalueTObjectCreationMode.eCreate_Default and TObjectCreationMode.eCreate_GlobalCopy create the same object with the same initial values.

Returns: IPCB_Primitive

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. Returns null for a kind that cannot be created this way, such as TObjectId.eRuleObject (use PCBRuleFactory) or TObjectId.eClassObject (use PCBClassFactory), and for TObjectId.eDimensionObject with TDimensionKind.eNoDimension.

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

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

Examples: Extension_CreatePCBLib, Extension_PcbLibComponentToSTEP, Extension_PlaceAndMovePcbComponent, Extension_PlacePad

PCBRuleFactory​

Creates a design rule (IPCB_Rule) of the given kind.

IPCB_Rule PCBRuleFactory(TRuleKind argRuleKind);
ParameterTypePassing
argRuleKindTRuleKindvalue

Returns: IPCB_Rule

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, IPCB_Rule.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.

PostBatchProcess​

Ends a batch started with PreBatchProcess, like PostProcess.

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

PostProcess​

Ends a change to the document of the current view that was started with PreProcess.

void PostProcess();

Returns: nothing (void)

Does nothing when the current view is not a PCB or PCB library document. Pairs of 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.

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

Examples: Extension_PlacePad

PreBatchProcess​

Starts a batch of changes to the document of the current view, like PreProcess.

void PreBatchProcess();

Returns: nothing (void)

Until PostBatchProcess, calls to PreProcess and 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

PreProcess​

Starts a change to the document of the current view; end it with PostProcess.

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 can nest.

See also: IPCB_ServerInterface.PostProcess

Examples: Extension_PlacePad

PrimitiveComparator​

Returns the IPCB_PrimitiveComparator object.

IPCB_PrimitiveComparator PrimitiveComparator();

Returns: IPCB_PrimitiveComparator

Extension method of IPCB_ServerInterfaceHelper (using PCB;).

Every call returns the same object.

RefreshDocumentView​

Refreshes the PCB editor view of an open document.

void RefreshDocumentView(string argDocumentPath);
ParameterTypePassingDescription
argDocumentPathstringvalueThe file name of the open document.

Returns: nothing (void)

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

RunFontEditorDialog​

No description yet.

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);
ParameterTypePassing
argTextHeightintref
argUseTTFontboolref
argStrokeFontNamestringref
argStrokeWidthintref
argTTFontNamestringref
argTTBoldboolref
argTTItalicboolref
argTTInvertedboolref
argTTInvertedBorderintref

Returns: bool

Returned by​

GlobalVars.PCBServer

Examples​

Used in the SDK examples: Extension_BOMManager, Extension_CreatePCBLib, Extension_InternalPlaneLayer, Extension_PCBUndoRedo, Extension_Pad_SolderMask.