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
| Property | Type | Access | Description |
|---|---|---|---|
| CanFastCrossSelect_Emit | bool | get; set | |
| CanFastCrossSelect_Receive | bool | get; set | |
| InteractiveRoutingOptions | IPCB_InteractiveRoutingOptions | get | The interactive routing options of the PCB editor. |
| PadViaLibraryManager | IPCB_PadViaLibraryManager | get | |
| SpecialStringConverter | IPCB_SpecialStringConverter | get | The converter of the special strings in PCB text. |
| SystemOptions | IPCB_SystemOptions | get | The system options of the PCB editor, such as its display options. |
| TTFLettersCache | IPCB_LettersCache | get | |
| TTFontsCache | IPCB_TTFontsCache | get |
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
| Method | Returns | Description |
|---|---|---|
| Board3DModelExporter | IPCB_Board3DModelExporter | Creates a new IPCB_Board3DModelExporter object on each call. |
| CreateComponentPainter | IPCB_ComponentPainterView | |
| CreateDocumentPainter | IPCB_DocumentPainterView | |
| CreateLayerStackupPainter | IPCB_LayerStackupDocumentPainterView | |
| CreatePCBLibComp | IPCB_LibComponent | Creates a new footprint (library component) that does not belong to a library. |
| CreatePCBLibrary | IPCB_Library | Creates a new PCB library that is not open as a document. |
| CreatePCBWideStringList | IPCB_WideStrings | Creates a new IPCB_WideStrings list. |
| DestroyPCBContour | void | Releases a contour created with PCBContourFactory and sets the variable to null. |
| DestroyPCBLibComp | void | Frees a footprint (library component) that does not belong to a library. |
| DestroyPCBLibrary | void | Frees a PCB library object. |
| DestroyPCBObject | void | Frees a PCB object created with PCBObjectFactory. |
| DisableFastParams | void | |
| DocumentLiveHighlight_Start | void | |
| DocumentLiveHighlight_Stop | void | |
| EnableFastParams | void | |
| GetCurrentPCBBoard | IPCB_Board | Returns the board of the document in the current view, a PCB document or a PCB library document. |
| GetCurrentPCBLibrary | IPCB_Library | Returns the library of the PCB library document in the current view. |
| GetOccWrapper | IOccWrapper | |
| GetParametersFactory | IPCB_ParametersFactory | |
| GetPCBBoardByBoardID | IPCB_Board | Returns the board whose IPCB_Board.BoardID has the given value. |
| GetPCBBoardByPath | IPCB_Board | Returns the board of an open PCB or PCB library document by its file name. |
| GetPCBLibraryByLibraryID | IPCB_Library | Returns the library whose IPCB_Library.LibraryID has the given value. |
| GetPCBLibraryByPath | IPCB_Library | Returns the library of an open PCB library document by its file name. |
| LayerSet | IPCB_LayerSetUtils | Returns the IPCB_LayerSetUtils object. |
| LayerUtils | IPCB_LayerUtils | Returns the IPCB_LayerUtils object. |
| LoadCompFromLibrary | IPCB_LibComponent | Loads a footprint from a PCB library file and returns it as an IPCB_LibComponent. |
| LoadPCBBoardByPath | IPCB_Board | Returns the board of a PCB document by its file name, loading the file when no open document has that name. |
| LoadPCBLibraryByPath | IPCB_Library | Returns the library of a PCB library document by its file name, loading the file when no open document has that name. |
| LoadPCBLibraryFromFile | IPCB_Library | 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 | uint | Draws a footprint of a PCB library file into a new bitmap and returns the bitmap's handle. |
| PcbApi_Export_ToPainter | void | |
| PCBClassFactory | IPCB_ObjectClass | Creates an object class (IPCB_ObjectClass) for the given kind of object. |
| PCBClassFactoryByClassMember | IPCB_ObjectClass | Creates an object class (IPCB_ObjectClass) whose members are of the given kind. |
| PCBContourFactory | IPCB_Contour | Creates a new, empty contour (with no points). |
| PCBContourMaker | IPCB_ContourMaker | Returns the IPCB_ContourMaker object. |
| PCBContourUtilities | IPCB_ContourUtilities | |
| PCBGeometricPolygonFactory | IPCB_GeometricPolygon | Creates a new, empty geometric polygon. |
| PCBGeometryMaker | IPCB_GeometryMaker | |
| PCBObjectFactory | IPCB_Primitive | Creates a new PCB design object of the given kind and returns it as an IPCB_Primitive. |
| PCBRuleFactory | IPCB_Rule | Creates a design rule (IPCB_Rule) of the given kind. |
| PostBatchProcess | void | Ends a batch started with PreBatchProcess, like PostProcess. |
| PostProcess | void | Ends a change to the document of the current view that was started with PreProcess. |
| PreBatchProcess | void | Starts a batch of changes to the document of the current view, like PreProcess. |
| PreProcess | void | Starts a change to the document of the current view; end it with PostProcess. |
| PrimitiveComparator | IPCB_PrimitiveComparator | Returns the IPCB_PrimitiveComparator object. |
| RefreshDocumentView | void | Refreshes the PCB editor view of an open document. |
| RunFontEditorDialog | bool |
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);
| Parameter | Type | Passing |
|---|---|---|
argMode | TPCB_DocumentPainterMode | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argPCBContour | IPCB_Contour | 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, 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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argPCBLibComp | IPCB_LibComponent | 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.
See also: IPCB_ServerInterface.CreatePCBLibComp
DestroyPCBLibrary
Frees a PCB library object.
void DestroyPCBLibrary(ref IPCB_Library argPCBLibrary);
void DestroyPCBLibrary(ref object argPCBLibrary);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argPCBLibrary | IPCB_Library | 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
DestroyPCBObject
Frees a PCB object created with PCBObjectFactory.
void DestroyPCBObject(ref IPCB_Primitive argPCBObject);
void DestroyPCBObject(ref object argPCBObject);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argPCBObject | IPCB_Primitive | 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
DisableFastParams
No description yet.
void DisableFastParams();
Returns: nothing (void)
DocumentLiveHighlight_Start
No description yet.
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.
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.
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);
| Parameter | Type | Passing |
|---|---|---|
argBoardID | int | value |
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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argPath | string | value | The 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);
| Parameter | Type | Passing |
|---|---|---|
argLibraryID | int | value |
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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argPath | string | value | The 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);
| 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
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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argPath | string | value | The 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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argPath | string | value | The 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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argPath | string | value | The 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);
| 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
PcbApi_Export_ToPainter
No description yet.
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) for the given kind of object.
IPCB_ObjectClass PCBClassFactory(TObjectId argClassKind);
| Parameter | Type | Passing |
|---|---|---|
argClassKind | TObjectId | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argClassKind | TClassMemberKind | value |
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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argObjectId | TObjectId | value | The kind of object to create, for example TObjectId.eTrackObject or TObjectId.eViaObject. |
argDimensionKind | TDimensionKind | value | The kind of dimension to create when argObjectId is TObjectId.eDimensionObject; ignored for other kinds. Pass TDimensionKind.eNoDimension for them. |
argCreationMode | TObjectCreationMode | value | TObjectCreationMode.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);
| Parameter | Type | Passing |
|---|---|---|
argRuleKind | TRuleKind | value |
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);
| 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.
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
Examples
Used in the SDK examples: Extension_BOMManager, Extension_CreatePCBLib, Extension_InternalPlaneLayer, Extension_PCBUndoRedo, Extension_Pad_SolderMask.