PCB API System Interfaces reference

Created: May 13, 2013 | Updated: October 23, 2018

This section covers the PCB API System Object Interfaces.

System Object Interfaces

Layer Object Interfaces


Options Object Interfaces

Note: The Altium Designer SDK is currently in the Beta phase and therefore evolving along with its documentation. This reference document, derived from the Altium Designer RTL documentation, is a work in progress and includes some aspects that are different to the new SDK.

IPCB_ServerInterface interface

(EDPInterfaces_PCB unit)
Overview
When you need to work with PCB design objects in Altium Designer, the starting point is to invoke the PCBServer function which returns the IPCB_ServerInterface interface. You can extract the all other derived PCB interfaces that are exposed in the I PCB_ServerInterface interface.
Note that these IServerModule interfaces represent loaded servers in Altium Designer. The Altium Designer application manages single instances of different server modules. Each server can have multiple server document kinds, for example the PCB server supports two server document kinds - PCB and PCBLIB design documents. A loaded server in Altium Designer typically hosts documents and each document in turn hosts a document view and panel views. Thus a PCB server also has the IServerModule interface along with the IPCB_ServerInterface interface.

Notes
To get an access to the current PCB document open in Altium Designer, you would invoke the GetCurrentPCBBoard method from the IPCB_ServerInterface interface object to obtain the IPCB_Board interface.
The factory methods produce specialized objects. For example the PCBObjectFactory method is invoked to produce a new PCB object. You will need to add this object in a PCB board. The TObjectCreationKind type denotes how the attributes of a new PCB object is set (either from software default settings or from global settings as defined in the Preferences dialog within PCB).
The SendMessageToRobots , PreProcess and PostProcess methods are used when you need to keep the Undo system and other sub systems of the PCB editor in synchronization, when you are adding, deleting or modifying objects to/from the PCB document.

IPCB_ServerInterface methods

IPCB_ServerInterface properties

PCBObjectFactory
PCBClassFactory
PCBClassFactoryByClassMember
PCBRuleFactory
PCBContourFactory
PCBContourMaker
LoadCompFromLibrary
DestroyPCBObject
DestroyPCBLibComp
GetPCBBoardByPath
GetCurrentPCBBoard
GetCurrentComponent
ObjectSupports
PreProcess
PostProcess
SendMessageToRobots
GetState_TTFLettersCache
GetState_TTFontsCache
EnableFastParams;
DisableFastParams;
DocumentLiveHighlight_Start
DocumentLiveHighlight_Stop
RefreshDocumentView

InteractiveRoutingOptions
SystemOptions
CanFastCrossSelect_Emit
CanFastCrossSelect_Receive
SpecialStringConverter
TTFLettersCache
TTFontsCache

See also
Creating/Deleting PCB objects and updating the Undo system
Modifying PCB objects and updating the Undo system
TObjectId enumerated values
TDimensionKind enumerated values
TObjectCreationMode enumerated values
IPCB_ObjectClass interface
IPCB_Rule interface
IPCB_LibComponent interface
IPCB_Primitive interface
IPCB_Board interface
IPCB_SystemOptions interface
IPCB_InteractiveRoutingOptions interface
PCB Scripts from \Examples\Scripts\Delphiscript\PCB folder.

GetState and SetState Methods

GetState_SystemOptions method

(IPCB_ServerInterface interface)
Syntax
Function GetState_SystemOptions : IPCB_SystemOptions;
Description
The function returns the IPCB_SystemOptions interface.
Example

See also
IPCB_ServerInterface interface
IPCB_SystemOptions interface

GetState_InteractiveRoutingOptions method

(IPCB_ServerInterface interface)
Syntax
Function GetState_InteractiveRoutingOptions : IPCB_InteractiveRoutingOptions;
Description

Example

See also
IPCB_ServerInterface interface

GetState_CanFastCrossSelect_Emit method

(IPCB_ServerInterface interface)
Syntax
Function GetState_CanFastCrossSelect_Emit : Boolean;
Description

Example

See also
IPCB_ServerInterface interface

GetState_CanFastCrossSelect_Receive method

(IPCB_ServerInterface interface)
Syntax
Function GetState_CanFastCrossSelect_Receive : Boolean;
Description

Example

See also
IPCB_ServerInterface interface

SetState_CanFastCrossSelect_Emit method

(IPCB_ServerInterface interface)
Syntax
Procedure SetState_CanFastCrossSelect_Emit (B : Boolean);
Description

Example

See also
IPCB_ServerInterface interface

SetState_CanFastCrossSelect_Receive method

(IPCB_ServerInterface interface)
Syntax
Procedure SetState_CanFastCrossSelect_Receive(B : Boolean);
Description

Example

See also
IPCB_ServerInterface interface

GetState_SpecialStringConverter method

(IPCB_ServerInterface interface)
Syntax
Function GetState_SpecialStringConverter : IPCB_SpecialStringConverter
Description
This function returns the Special String converter interface which deals with special string formats of PCB text objects.
Example

See also
IPCB_SpecialStringConverter interface
SpecialStringConverter property

Methods

CreatePCBLibComp method

(IPCB_ServerInterface interface)
Syntax
Function CreatePCBLibComp : IPCB_LibComponent;
Description
The CreatePCBLibComp method creates a IPCB_LibComponent based object interface that represents a library component within a library document.
Example

Var CurrentLib : IPCB_Library; NewPCBLibComp : IPCB_LibComponent; NewPad : IPCB_Pad; Begin If PCBServer = Nil Then Exit; CurrentLib := PcbServer.GetCurrentPCBLibrary; If CurrentLib = Nil Then Exit; NewPCBLibComp := PCBServer.CreatePCBLibComp; NewPcbLibComp.Name := 'ANewComponent'; CurrentLib.RegisterComponent(NewPCBLibComp); PCBServer.PreProcess; NewPad := PcbServer.PCBObjectFactory(ePadObject,eNoDimension,eCreate_Default); NewPad.X := MilsToCoord(0); NewPad.Y := MilsToCoord(0); NewPad.TopXSize := MilsToCoord(62); NewPad.TopYSize := MilsToCoord(62); NewPad.HoleSize := MilsToCoord(28); NewPad.Layer := eMultiLayer; NewPad.Name := '1'; NewPCBLibComp.AddPCBObject(NewPad); PCBServer.SendMessageToRobots(CurrentLib.Board.I_ObjectAddress, c_Broadcast, PCBM_BoardRegisteration, NewPCBLibComp.I_ObjectAddress); PCBServer.PostProcess; CurrentLib.CurrentComponent := NewPcbLibComp; CurrentLib.Board.ViewManager_FullUpdate; End;

See also
IPCB_ServerInterface interface
IPCB_LibComponent interface
DestroyPCBLibComp method
IPCB_Board and its ViewManager_FullUpdate method.

DestroyPCBLibObject method

(IPCB_ServerInterface interface)
Syntax
Procedure DestroyPCBLibComp (Var APCBLibComp : IPCB_LibComponent);
Description
This procedure destroys a footprint within a library but it is not eliminated from the computer's memory. A library is composed of footprints as pages and each footprint is represented by the IPCB_LibComponent interface.

Example

See also
IPCB_ServerInterface interface

PCBDestroyObject method

(IPCB_ServerInterface interface)
Syntax
Procedure DestroyPCBObject (Var APCBObject : IPCB_Primitive);
Description
This procedure destroys a PCB object from the PCB document. It is removed but not eliminated from computer memory. For instance, the Undo system can bring this object back.
Example

var CurrentPCBBoard : IPCB_Board; Iterator : IPCB_BoardIterator; Track : IPCB_Track; OldTrack : IPCB_Track; Begin CurrentPCBBoard := PCBServer.GetCurrentPCBBoard; If CurrentPCBBoard = Nil Then Exit; Iterator := CurrentPCBBoard.BoardIterator_Create; If Iterator = Nil Then Exit; Iterator.AddFilter_ObjectSet(MkSet(eTrackObject)); Iterator.AddFilter_LayerSet(MkSet(eTopLayer)); PCBServer.PreProcess; Try Track := Iterator.FirstPCBObject; While Track <> Nil Do Begin OldTrack := Track; Track := Iterator.NextPCBObject; CurrentPCBBoard.RemovePCBObject(OldTrack); PCBServer.SendMessageToRobots(CurrentPCBBoard.I_ObjectAddress, c_BroadCast, PCBM_BoardRegisteration, OldTrack.I_ObjectAddress); End; Finally CurrentPCBBoard.BoardIterator_Destroy(Iterator); End; PCBServer.PostProcess; // Refresh PCB screen Client.SendMessage('PCB:Zoom', 'Action=Redraw' , 255, Client.CurrentView); End;

See also
IPCB_ServerInterface interface
IPCB_LibComponent interface

GetCurrentPCBBoard method


(IPCB_ServerInterface interface)
Syntax
Function GetCurrentPCBBoard : IPCB_Board;
Description
This function returns you the IPCB_Board interface which represents the PCB document OR the PCB Library document. The IPCB_Board interface has a IsLibrary function which determines which type the document is; the PCB or PCBLib document.
Example

Var Board : IPCB_Board; Begin Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; If Not Board.IsLibrary Then Begin showMessage('This is not a PCB library document.'); Exit; End; End;

See also
IPCB_ServerInterface interface

GetCurrentPCBLibrary property

(IPCB_ServerInterface interface)
Syntax
Function GetCurrentPCBLibrary : IPCB_Library;
Description
This function returns the IPCB_Library interface which represents the PCB library document.
Example

Var CurrentLib : IPCB_Library; FootprintIterator : IPCB_LibraryIterator; Footprint : IPCB_LibComponent; Begin CurrentLib := PCBServer.GetCurrentPCBLibrary; If CurrentLib = Nil Then Begin ShowMessage('This is not a PCB Library document'); Exit; End; // Each page of library is a footprint FootprintIterator := CurrentLib.LibraryIterator_Create; FootprintIterator.SetState_FilterAll; Footprint := FootprintIterator.FirstPCBObject; While Footprint <> Nil Do Begin // do what you want with the footprint... Footprint := FootprintIterator.NextPCBObject; End; Finally CurrentLib.LibraryIterator_Destroy(FootprintIterator); End;

See also
IPCB_ServerInterface interface
IPCB_Library interface

GetPCBBoardByPath method

(IPCB_ServerInterface interface)
Syntax
Function GetPCBBoardByPath (APath : TPCBString) : IPCB_Board;
Description
This function returns you the IPCB_Board interface representing the PCB document only if the path (APath parameter) represents a valid PCB document.
Example

See also
IPCB_ServerInterface interface

GetPCBLibraryByPath method

(IPCB_ServerInterface interface)
Syntax
Function GetPCBLibraryByPath (Const APath : TPCBString) : IPCB_Library;
Description
This function returns you the IPCB_Library interface representing the PCB document only if the path (APath parameter) represents this document.
Example

See also
IPCB_ServerInterface interface
IPCB_Library interface

ObjectSupports method

(IPCB_ServerInterface interface)
Syntax
Function ObjectSupports(Const Instance : TObject; Const IID : TGUID; Out Intf) : Boolean;
Description
This function checks if the PCB object in question is in fact one of the valid PCB object interfaces.
Example

See also
IPCB_ServerInterface interface

PCBClassObjectFactory method

(IPCB_ServerInterface interface)
Syntax
Function PCBClassFactory(Const AClassKind : TObjectId) : IPCB_ObjectClass;
Description
This function produces an object represented by the IPCB_ObjectClass interface. An Object class is a Design Rules Class that can store members which represent a group of design objects targetted by the design rules system in the PCB editor.
Example

Procedure CreateANewNetClass; Var Board : IPCB_Board; NetClass : IPCB_ObjectClass; Begin Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; Try PCBServer.PreProcess; NetClass := PCBServer.PCBClassFactoryByClassMember(eClassMemberKind_Net); NetClass.SuperClass := False; NetClass.Name := 'NetGndClass'; NetClass.AddMemberByName('GND'); Board.AddPCBObject(NetClass); Finally PCBServer.PostProcess; End; End;

See also
IPCB_ServerInterface interface
PCBClassObjectFactoryByClassMember method

PCBClassObjectFactoryByClassMember method

(IPCB_ServerInterface interface)
Syntax
Function PCBClassFactoryByClassMember (Const AClassKind : TClassMemberKind) : IPCB_ObjectClass;
Description
This function produces an object represented by the IPCB_ObjectClass interface. An Object class is a Design Rules Class that can store members which represent a group of design objects targetted by the design rules system in the PCB editor.
Example

Procedure CreateANewNetClass; Var Board : IPCB_Board; NetClass : IPCB_ObjectClass; Begin Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; Try PCBServer.PreProcess; NetClass := PCBServer.PCBClassFactoryByClassMember(eClassMemberKind_Net); NetClass.SuperClass := False; NetClass.Name := 'NetGndClass'; NetClass.AddMemberByName('GND'); Board.AddPCBObject(NetClass); Finally PCBServer.PostProcess; End; End;

See also
IPCB_ServerInterface interface
PCBClassObjectFactory method

LoadCompFromLibrary method

(IPCB_ServerInterface interface)
Syntax
Function LoadCompFromLibrary(Const APattern : TPCBString;
Const ALibPath : TPCBString) : IPCB_LibComponent;
Description
This function produces an object which is represented by the IPCB_LibComponent interface. A footprint in a library is also represented by the IPCB_LibComponent interface.
Example

See also
IPCB_ServerInterface interface
IPCB_LibComponent interface

PCBObjectFactory method

(IPCB_ServerInterface interface)
Syntax
Function PCBObjectFactory(Const AObjectId : TObjectId;
Const ADimensionKind : TDimensionKind = eNoDimension;
Const ACreationMode : TObjectCreationMode =
eCreate_Default) : IPCB_Primitive;

Description
This function produces a PCB design object which is represented by the IPCB_Primitive interface. The IPCB_Primitive interface is the ancestor interface for all PCB design objects in Altium Designer.
The TObjectID value determines which object you wish to produce.
The TDimensionKind value determines which dimension object you wish to produce. By default it is eNoDimension.
The TObjectCreationMode type determines which default values are used - from the PCB Preferences dialog or default values used internally from the PCB Editor.

 

Var Board : IPCB_Board; Var Via : IPCB_Via; Begin Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; // Create a Via object Via := PCBServer.PCBObjectFactory(eViaObject, eNoDimension, eCreate_Default); Via.X := MilsToCoord(7500); Via.Y := MilsToCoord(7500); Via.Size := MilsToCoord(50); Via.HoleSize := MilsToCoord(20); Via.LowLayer := eTopLayer; Via.HighLayer := eBottomLayer; // Put the new Via object in the board object Board.AddPCBObject(Via); // Refresh the PCB screen Client.SendMessage('PCB:Zoom', 'Action=Redraw' , 255, Client.CurrentView); End;

 

Example

See also

IPCB_ServerInterface interface

PCBRuleFactory method

(IPCB_ServerInterface interface)
Syntax
Function PCBRuleFactory(Const ARuleKind : TRuleKind) : IPCB_Rule;
Description
This function produces a design rule object which is represented by the IPCB_Rule interface.
Example

See also
IPCB_ServerInterface interface

PostProcess method

(IPCB_ServerInterface interface)
Syntax
Procedure PostProcess;
Description
This procedure cleans up the robots process in the PCB editor, after a PreProcess method and SendMessageToRobots messages have been invoked. This also stops the robots from listening to any more PCB messages.

Example

PCBServer.PreProcess; //Notify PCB that the fill object is going to be changed. PCBServer.SendMessageToRobots( Fill.I_ObjectAddress, c_Broadcast, PCBM_BeginModify , c_NoEventData); Fill.Layer := eBottomLayer; //Notify PCB that the fill object has been changed. PCBServer.SendMessageToRobots( Fill.I_ObjectAddress, c_Broadcast, PCBM_EndModify , c_NoEventData); PCBServer.PostProcess;

See also
IPCB_ServerInterface interface
PreProcess method
SendMessageToRobots method

Preprocess method

(IPCB_ServerInterface interface)
Syntax
Procedure PreProcess;
Description
This procedure initializes the PCB robots in the PCB editor so that the robots can listen to any PCB messages being broadcasted. It is highly recommended to use Try Finally End blocks in your scripts or server code so that PreProcess and PostProcess methods can always be executed. This is imperative to ensure that the PCB editor is in the correct state.

Example

Try PCBServer.PreProcess; //Notify PCB that the fill object is going to be changed. PCBServer.SendMessageToRobots( Fill.I_ObjectAddress, c_Broadcast, PCBM_BeginModify , c_NoEventData); Fill.Layer := eBottomLayer; //Notify PCB that the fill object has been changed. PCBServer.SendMessageToRobots( Fill.I_ObjectAddress, c_Broadcast, PCBM_EndModify , c_NoEventData); Finally PCBServer.PostProcess; End;

See also
IPCB_ServerInterface interface
PostProcess method
SendMessageToRobots method

SendMessageToRobots method

(IPCB_ServerInterface interface)
Syntax
Procedure SendMessageToRobots(Source, Destination : Pointer; MessageID : Word; MessageData : Pointer);

Description
The SendMessageToRobots method sends a specific Message with the Source and Designation parameters into the PCB editor where the PCB robots are listening. It is necessary to invoke the PreProcess method first, and to invoke the PostProcess method after the SendMessageToRobots methods.

Parameters
The Source parameter represents the PCB object. You need to pass in the address of this object, thus the I_ObjectAddress method of a PCB Object Interface returns the address.
The Destination parameter normally has the c_Broadcast constant which denotes that the message is being broadcasted into the PCB editor.
The MessageId parameter represents one of the PCB message constants. See PCB Messages section for more details.
The MessageData parameter can be one of the following values - c_NoEventData when a PCB object is being modified, or when this object is being registered into the PCB editor, and you need to pass in the address of this object, thus the I_ObjectAddress method of a PCB Object Interface need to be invoked to return the address.
Notes
The PCB Messages are messages that are broadcasted into the PCB Editor server by the SendMessageToRobots method. There are different types of messages that describe a specific action within the PCB server.

Example 1 - SendMessageToRobots with BeginModify and EndModify calls

//Initialize robots in PCB PCBServer.PreProcess; //Notify PCB that the fill object is going to be changed. PCBServer.SendMessageToRobots( Fill.I_ObjectAddress, c_Broadcast, PCBM_BeginModify , c_NoEventData); Fill.Layer := eBottomLayer; //Notify PCB that the fill object has been changed. PCBServer.SendMessageToRobots( Fill.I_ObjectAddress, c_Broadcast, PCBM_EndModify , c_NoEventData); // Clean up robots in PCB PCBServer.PostProcess;

Example 2 - SendMessageToRobots with BoardRegistration call

//Initialize robots in PCB PCBServer.PreProcess; //Create a text object; TextObj := PCBServer.PCBObjectFactory(eTextObject, eNoDimension, eCreate_Default); // notify the event manager that the pcb object is going to be modified PCBServer.SendMessageToRobots(TextObj.I_ObjectAddress ,c_Broadcast, PCBM_BeginModify , c_NoEventData); TextObj.XLocation := Sheet.SheetX + MilsToCoord(100); TextObj.YLocation := Sheet.SheetY + MilsToCoord(100); TextObj.Layer := eTopOverlay; TextObj.Text := 'Text1'; TextObj.Size := MilsToCoord(90); // sets the height of the text. Board.AddPCBObject(TextObj); // notify the event manager that the pcb object has been modified PCBServer.SendMessageToRobots(TextObj.I_ObjectAddress, c_Broadcast, PCBM_EndModify , c_NoEventData); // notify that the pcb object has been registered in PCB. PCBServer.SendMessageToRobots(Board.I_ObjectAddress, c_Broadcast, PCBM_BoardRegisteration, TextObj.I_ObjectAddress); // Clean up robots in PCB PCBServer.PostProcess;

See also
IPCB_ServerInterface interface
PostProcess method
SendMessageToRobots method
PCB Message Constants

PCBContourFactory method

(IPCB_ServerInterface interface)
Syntax
Function PCBContourFactory (AArcResolution : TCoord;
Const ACX : TCoord = 0;
Const ACY : TCoord = 0;
Const ARotation : TAngle = 0) : IPCB_Contour;
Description
The PCBContourFactory function creates a contour object based on the Arc resolution, the centre X and Y coordinates and the orientation of the contour.
Example

See also
IPCB_Contour interface
DestroyPCBContour method

DestroyPCBContour method

(IPCB_ServerInterface interface)
Syntax
Procedure DestroyPCBContour (Var APCBContour : IPCB_Contour);
Description
This DestroyPCBContour method destroys the object represented by the IPCB_Contour interface which was created by the PCBContourFactory method.
Example

See also
IPCB_Contour interface
PCBContourFactory method

Properties

InteractiveRoutingOptions property
(IPCB_ServerInterface interface)
Syntax
Property InteractiveRoutingOptions : IPCB_InteractiveRoutingOptions Read GetState_InteractiveRoutingOptions;
Description
This property returns you the IPCB_InteractiveRoutingOptions interface which represents the interactive routing options in the PCB editor.
Example

See also
IPCB_ServerInterface interface
IPCB_InteractiveRoutingOptions interface

SystemOptions property
(IPCB_ServerInterface interface)
Syntax
Property SystemOptions : IPCB_SystemOptions Read GetState_SystemOptions;
Description
The property returns you the IPCB_SystemOptions interface. This interface is represented by the System Options in the PCB editor such as PCB document display options,
Example

See also
IPCB_ServerInterface interface
IPCB_SystemOptions interface


CanFastCrossSelect_Emit property
(IPCB_ServerInterface interface)
Syntax
Property CanFastCrossSelect_Emit : Boolean Read GetState_CanFastCrossSelect_Emit Write SetState_CanFastCrossSelect_Emit;
Description

Example

See also
IPCB_ServerInterface interface


CanFastCrossSelect_Receive property
(IPCB_ServerInterface interface)
Syntax
Property CanFastCrossSelect_Receive : Boolean Read GetState_CanFastCrossSelect_Receive Write SetState_CanFastCrossSelect_Receive;
Description

Example

See also
IPCB_ServerInterface interface


SpecialStringConverter property
(IPCB_ServerInterface interface)
Syntax
Property SpecialStringConverter : IPCB_SpecialStringConverter Read GetState_SpecialStringConverter;
Description
This property is a read only property, however if you obtain the IPCB_SpecialStringConverter interface, then you can invoke methods or properties to change the data within.
Example

See also
IPCB_ServerInterface interface
IPCB_SpecialStringConverter interface


TTFLettersCache property
(IPCB_ServerInterface interface)
Syntax
Property TTFLettersCache : IPCB_LettersCache Read GetState_TTFLettersCache;
Description

Example

See also
IPCB_ServerInterface interface

TTFontsCache property

(IPCB_ServerInterface interface)
Syntax
Property TTFontsCache : IPCB_TTFontsCache Read GetState_TTFontsCache;
Description

Example

See also
IPCB_ServerInterface interface

IPCB_Board interface

(RT_PCB unit)
Overview
The IPCB_Board interface encapsulates an opened PCB document in Altium Designer and from this board interface object, you can add, delete PCB design objects, find out which layers are used and so on.
The IPCB_Board interface has iterative methods and interactive feedback methods. Basically you can retrieve an object interface for the PCB design object on the PCB that was clicked on. You can also retrieve the coordinates based on the mouse click on the PCB and also you can conduct defined searches on a PCB document with the parameters you have set up for the iterator. Refer to the Iterators section for more details.
This IPCB_Board is also used in the IPCB_Library interface. A library document is a bit more complex because it has a list of footprints (components with unnamed designators) and each footprint is shown in a PCB Library document. There is a three way relationship: the IPCB_Board , the IPCB_LibComponent and the IPCB_Library interfaces that all work together for the PCB library document.

Notes
Check if the PCB server exists and if there is a PCB document before you invoke any PCB interface methods. For example
PCBBoard := PCBServer.GetCurrentPCBBoard;
If PCBBoard = Nil Then Exit;

Some properties are only read only, meaning you can only retrieve data from property but not modify the data.
To create a new object and add to the board object, firstly invoke the PCBObjectFactory from the IPCB_ServerInterface interface and then invoke the AddPCBObject method from a IPCB_Board interface.
To look for objects on a PCB document, use one of the following iterators; Board Iterator, Group Iterator, Spatial iterator or a library iterator for PCB Library documents.
Interactive feedback from the board can be done with the following methods: GetObjectAtCursor , GetObjectAtXYAskUserIfAmbiguous , ChooseRectangleByCorners and ChooseLocation functions.

IPCB_Board methods

IPCB_Board properties

WindowBoundingRectangle
LayerPositionInSet
BoardIterator_Create
BoardIterator_Destroy
SpatialIterator_Create
SpatialIterator_Destroy
AddPCBObject
RemovePCBObject
AddObjectToHighlightObjectList
GetPrimitiveCount
ConnectivelyValidateNets
ViewManager_Graphically
InvalidatePrimitive
GetPcbComponentByRefDes
Navigate_RedrawChangedObjectsInBoard
SetState_DocumentHasChanged
SetState_Navigate_HighlightObjectList
SetState_SaveCurrentStatusOfObjectsInBoard
SetState_ViewManager_FilterChanging
ShowPCBObject
HidePCBObject
InvertPCBObject
CreateBoardOutline
UpdateBoardOutline
RebuildBoardOutline
GetObjectAtCursor
GetObjectAtXYAskUserIfAmbiguous
ChooseRectangleByCorners
ChooseLocation
ContextMenuObjectCount
GetLastClickedObject
FindDominantRuleForObject
FindDominantRuleForObjectPair
PrimPrimDistance
AnalyzeNet
CleanNet
GetState_SplitPlaneNets
GetPrimitiveCounter
ClearUndoRedo
NewUndo
EndUndo
DoUndo
DoRedo
GraphicalView_ZoomRedraw;
GraphicalView_ZoomOnRect
GetState_SelectecObjectCount
GetState_SelectecObject
RebuildPadCaches
RuleNameUnique
NetNameIsUnique
DifferentialPairNameIsUnique
ClassNameIsUnique

PCBWindow
FileName
XOrigin
YOrigin
XCursor
YCursor
DisplayUnit
CurrentLayer
LayerStack
LayerColor
SnapGridUnit
BigVisibleGridUnit
VisibleGridUnit
BigVisibleGridSize
VisibleGridSize
SnapGridSize
SnapGridSizeX
SnapGridSizeY
TrackGridSize
ViaGridSize
ComponentGridSize
ComponentGridSizeX
ComponentGridSizeY
DrawDotGrid
OutputOptions
ECOOptions
GerberOptions
PrinterOptions
PlacerOptions
LayerIsDisplayed
LayerIsUsed
InternalPlaneNetName
InternalPlane1NetName
InternalPlane2NetName
InternalPlane3NetName
InternalPlane4NetName
DrillLayerPairsCount
LayerPair
MechanicalPairs
BoardOutline
AutomaticSplitPlanes
PCBSheet
SelectecObjectCount
SelectecObject
PrimitiveCounter

See also
TLayer enumerated values
IPCB_Library interface
IPCB_LayerStack interface
IPCB_OutputOptions interface
IPCB_ECOOptions interface
IPCB_GerberOptions interface
IPCB_PrinterOptions interface
IPCB_AdvancedPlacerOptions interface
QueryUsedLayers script in \Examples\Scripts\PCB folder
SpatialIterator script in \Examples\Scripts\PCB folder

Methods

AddObjectToHighlightObjectList method

(IPCB_Board interface)
Syntax
Procedure AddObjectToHighlightObjectList(iPrimitive : IPCB_Primitive);
Description

Example

See also
IPCB_Board interface

AddPCBObject method

(IPCB_Board interface)
Syntax
Procedure AddPCBObject(PCBObject : IPCB_Primitive);
Description
The AddPCBObject method adds a new Design Object into the PCB document after this object was created by the PCBObjectFactory method from the IPCB_ServerInterface interface.
To successfully create and register a PCB design object onto a PCB document, you need to employ the IPCB_PCBServer's PreProcess, PostProcess and SendMessageToRobots messages. A ViewManager_FullUpdate

DelphiScript Example

Var Board : IPCB_Board; BR : TCoordRect; Sheet : IPCB_Sheet; Via : IPCB_Via; PadCache : TPadCache; Begin // Grab the board interface representing the current PCB document in DXP. Board := PCBServer.GetCurrentPCBBoard; // If the board interface doesnt exist (no PCB document) then exit. If Board = Nil Then Exit; // Initialize the systems in the PCB Editor. PCBServer.PreProcess; Sheet := Board.PCBSheet; // Create a Via object with the PCBObjectFactory method // and then with the new attributes. // Note we convert values in Mils to internal coordinates // using the MilsToCoord function. All PCB objects locations and sizes // have internal coordinate units where 1 mil = 10000 internal units Via := PCBServer.PCBObjectFactory(eViaObject, eNoDimension, eCreate_Default); // obtain the bottom left coordinates of the board outline BR := Board.BoardOutline.BoundingRectangle; Via.x := BR.Left \\+ MilsToCoord(500); Via.y := BR.Bottom \\+ MilsToCoord(500); // Via.x := Sheet.SheetX \\+ MilsToCoord(500); // Via.y := Sheet.SheetY \\+ MilsToCoord(500); Via.Size := MilsToCoord(50); Via.HoleSize := MilsToCoord(20); // Assign Via to the Top layer and bottom layer. Via.LowLayer := eTopLayer; Via.HighLayer := eBottomLayer; // Set up Cache info for Via // which consists mainly solder mask, paste mask and power plane values from design rules Padcache := Via.GetState_Cache; Padcache.ReliefAirGap := MilsToCoord(11); Padcache.PowerPlaneReliefExpansion := MilsToCoord(11); Padcache.PowerPlaneClearance := MilsToCoord(11); Padcache.ReliefConductorWidth := MilsToCoord(11); Padcache.SolderMaskExpansion := MilsToCoord(11); Padcache.SolderMaskExpansionValid := eCacheManual; Padcache.PasteMaskExpansion := MilsToCoord(11); Padcache.PasteMaskExpansionValid := eCacheManual; // Assign the new pad cache to the via Via.SetState_Cache := Padcache; // Put the new Via object on the board Board.AddPCBObject(Via); // Update the Undo System in DXP that a new VIa object has been added to the board PCBServer.SendMessageToRobots(Board .I_ObjectAddress, c_Broadcast, PCBM_BoardRegisteration, Via.I_ObjectAddress); // Finalize the systems in the PCB Editor. PCBServer.PostProcess; //Full PCB system update Board.ViewManager_FullUpdate; // Refresh PCB screen Client.SendMessage('PCB:Zoom', 'Action=Redraw' , 255, Client.CurrentView); End;

See also
IPCB_Board interface

AnalyzeNet method

(IPCB_Board interface)
Syntax
Procedure AnalyzeNet(Const ANet : IPCB_Net);
Description
This procedure analyzes a supplied net object in the form of IPCB_Net interface.
Example

See also
IPCB_Board interface

BoardIterator_Create method

(IPCB_Board interface)
Syntax
Function BoardIterator_Create : IPCB_BoardIterator;
Description
The BoardIterator_Create method creates a board iterator which is used to search for design objects on the PCB document. After the search has been conducted, invoke the BoardIterator_Destroy method to destroy the board iterator object.
Example

// Retrieve the iterator Iterator := Board.BoardIterator_Create; Iterator.AddFilter_ObjectSet(MkSet(ePadObject)); Iterator.AddFilter_LayerSet(AllLayers); Iterator.AddFilter_Method(eProcessAll); // Search and count pads Pad := Iterator.FirstPCBObject; While (Pad <> Nil) Do Begin Inc(PadNumber); Pad := Iterator.NextPCBObject; End; Board.BoardIterator_Destroy(Iterator);

See also
IPCB_Board interface

BoardIterator_Destroy method

(IPCB_Board interface)
Syntax
Procedure BoardIterator_Destroy(Var AIterator : IPCB_BoardIterator);
Description
The BoardIterator_Destroy method destroys the board iterator object after it has been used to conduct a search on the PCB document for specified board objects.
Example

// retrieve the iterator Iterator := Board.BoardIterator_Create; Iterator.AddFilter_ObjectSet(MkSet(ePadObject)); Iterator.AddFilter_LayerSet(AllLayers); Iterator.AddFilter_Method(eProcessAll); // Search and count pads Pad := Iterator.FirstPCBObject; While (Pad <> Nil) Do Begin Inc(PadNumber); Pad := Iterator.NextPCBObject; End; Board.BoardIterator_Destroy(Iterator);

See also
IPCB_Board interface
BoardIterator_Create method.

ChooseLocation method

(IPCB_Board interface)
Syntax
Function ChooseLocation(Var X1, Y1 : TCoord; Prompt : TPCBString): Boolean;

Description
The function returns you the X1 and Y1 coordinates of the PCB Document after you have clicked on a location on the PCB document. When this function is excuted, you are prompted with a cross hair cursor (being in the interactive mode) and the status bar of the Altium Designer appears with the Prompt string.
This function returns a boolean value whether a location has been retrieved or not. if you click Escape key for example, the function does not return the location values and returns a False value.

DelphiScript Example

Try Board := PCBServer.GetCurrentPCBBoard; If Not Assigned(Board) Then Begin ShowMessage('The Current Document is not a Protel PCB Document.'); Exit; End; Repeat Board.ChooseLocation(x,y, 'Choose Component1'); Comp1 := Board.GetObjectAtXYAskUserIfAmbiguous(x,y,MkSet(eComponentObject),AllLayers, eEditAction_Select); If Not Assigned(Comp1) Then Exit; Board.ChooseLocation(x,y, 'Choose Component2'); Comp2 := Board.GetObjectAtXYAskUserIfAmbiguous(x,y,MkSet(eComponentObject),AllLayers, eEditAction_Select); If Not Assigned(Comp2) Then Exit; // do what yo want with Comp1 and Comp2 // click on the board to exit or RMB Until (Comp1 = Nil) Or (Comp2 = Nil); Finally Pcbserver.PostProcess; Client.SendMessage('PCB:Zoom', 'Action=Redraw', 255, Client.CurrentView); End; End

See also
IPCB_Board interface

ChooseRectangleByCorners method

(IPCB_Board interface)
Syntax
Function ChooseRectangleByCorners(Prompt1 : TPCBString;
Prompt2 : TPCBString;
Var X1, Y1,
X2, Y2 : TCoord) : Boolean;
Description
The ChooseRectangleByCorners method prompts you twice to choose the two sets of coordinates that define a boundary rectangle on the PCB document. When this method is executed, the PCB is in interactive mode with a cross hair cursor, waiting for the user to click on the PCB document.
The method returns you the X1,Y1, X2, Y2 values that can be used for calculations or for the spatial iterator for example and a True value.
However if the method was exit prematurely for example the user clicks Escape key or the right mouse button, the method returns a false value.

DelphiScript Example

Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; If Not (Board.ChooseRectangleByCorners( 'Choose first corner', 'Choose final corner', x1,y1,x2,y2)) Then Exit; // The coordinates from the ChooseRectangleByCorners method // can be used for a spatial iterator for example

See also
IPCB_Board interface
IPCB_SpatialIterator
ChooseLocation method

CleanNet method

(IPCB_Board interface)
Syntax
Procedure CleanNet(Const ANet : IPCB_Net);
Description
The CleanNet procedure cleans up the net represented by the IPCB_Net parameter. It cleans up by re-organizing and re-arranging the net topology of this net.
Example

See also
IPCB_Board interface

ClearUndoRedo method

(IPCB_Board interface)
Syntax
Procedure ClearUndoRedo;
Description
This clears out the UndoRedo facility in the PCB editor.
Example

See also
IPCB_Board interface

ConnectivelyValidateNets method

(IPCB_Board interface)
Syntax
Procedure ConnectivelyValidateNets;
Description
This procedure validates the connectivity of nets on the PCB document.
Example

See also
IPCB_Board interface

CreateBoardOutline method

(IPCB_Board interface)
Syntax
Function CreateBoardOutline : IPCB_BoardOutline;
Description
The function creates a board outline represented by the IPCB_BoardOutline interface. To adjust the parameters of the Board outline, please consult the IPCB_BoardOutline interface entry.
Example

See also
IPCB_Board interface
IPCB_BoardOutline interface

DoRedo method

(IPCB_Board interface)
Syntax
Procedure DoRedo;
Description
This procedure invokes the Redo facility in the PCB editor.
Example

See also
IPCB_Board interface

DoUndo method

(IPCB_Board interface)
Syntax
Procedure DoUndo;
Description
This procedure invokes the Undo facility in the PCB editor.
Example

See also
IPCB_Board interface

EnableAllPrimitives method

(IPCB_Board interface)
Syntax
Procedure EnableAllPrimitives(enable : Boolean);
Description
This procedure enables all primitives on the PCB document.
Example

See also
IPCB_Board interface

EndUndo method

(IPCB_Board interface)
Syntax
Procedure EndUndo;
Description
This procedure ends the Undo process in the PCB editor.
Example

See also
IPCB_Board interface

FindDominantRuleForObject method

(IPCB_Board interface)
Syntax
Function FindDominantRuleForObject(APrimitive : IPCB_Primitive;
ARuleKind : TRuleKInd) : IPCB_Rule;
Description
This function returns the dominant specified rule for the primitive which is targetted by this rule.
Example

See also
IPCB_Board interface

FindDominantRuleForObjectPair method

(IPCB_Board interface)
Syntax
Function FindDominantRuleForObjectPair(APrimitive1,
APrimitive2 : IPCB_Primitive;
ARuleKind : TRuleKInd) : IPCB_Rule;
Description
This function returns the dominant specified binary rule for the two primitives which are targetted by this rule.
Example

See also
IPCB_Board interface

GetObjectAtXYAskUserIfAmbiguous method

(IPCB_Board interface)
Syntax
Function GetObjectAtXYAskUserIfAmbiguous(HitX,
HitY : TCoord;
ObjectSet : TObjectSet;
LayerSet : TLayerSet;
Action : TEditingAction) : IPCB_Primitive;
Description
This function returns you the specified object with the specified X and Y coordinates which could be retrieved by the ChooseLocation method for example.
This function is useful when there are overlapping objects on the PCB document and you need to retrieve the specific object type.
The function returns the design object with the following parameters.
Parameters
The HitX parameter specifies the X coordinate value.
The HitY parameter specifies the Y coordinate value.
The ObjectSet parameter specifies which object types can be returned.
The LayerSet parameter specifies the objects on which layers that can be returned.
The Action parameter specifies what is happening when this method is invoked.

DelphiScript Example

Var Board : IPCB_Board; Comp1 : IPCB_Component; Comp2 : IPCB_Component; x,y, : TCoord; x1, y1 : TCoord; Rotation : TAngle; Begin Pcbserver.PreProcess; Try Board := PCBServer.GetCurrentPCBBoard; If Not Assigned(Board) Then Begin ShowMessage('The Current Document is not a Protel PCB Document.'); Exit; End; Repeat Board.ChooseLocation(x,y, 'Choose Component1'); Comp1 := Board.GetObjectAtXYAskUserIfAmbiguous(x,y,MkSet(eComponentObject),AllLayers, eEditAction_Select); If Not Assigned(Comp1) Then Exit; // click on the board to exit or RMB Until (Comp1 = Nil); Finally Pcbserver.PostProcess; Client.SendMessage('PCB:Zoom', 'Action=Redraw', 255, Client.CurrentView); End; End;

See also
IPCB_Board interface
ChooseLocation method
TObjectSet type
TLayerSet type
TEditingAction type

GetObjectAtCursor method

(IPCB_Board interface)
Syntax
Function GetObjectAtCursor(ObjectSet : TObjectSet;
LayerSet : TLayerSet;
StatusBarText : TPCBString) : IPCB_Primitive;
Description
This function returns the design object that is within the mouse's clicked coordinates on the PCB document.
Parameters
The ObjectSet parameter specifies which object types can be returned.
The LayerSet parameter specifies the objects on which layers that can be returned.
The StatusbarText parameter specifies the text on the status bar of the Altium Designer application when the function is invoked.
Example

See also
IPCB_Board interface

GetPcbComponentByRefDes method

(IPCB_Board interface)
Syntax
Function GetPcbComponentByRefDes(Value : TString) : IPCB_Component;
Description
This function returns the component by its valid reference designator.
Example

See also
IPCB_Board interface

GetPrimitiveCount method

(IPCB_Board interface)
Syntax
Function GetPrimitiveCount(AObjSet : TObjectSet;
LayerSet : TLayerSet;
AMethod : TIterationMethod) :Integer;
Description
The function returns the number of primitives which is dependent on the parameters supplied - the object kinds to look for, which layers to look for and how the search is conducted.
Parameters
The ObjectSet parameter specifies which object types can be returned.
The LayerSet parameter specifies the objects on which layers that can be returned.
The AMethod parameter specifies how the search is conducted.
Example

See also
IPCB_Board interface
TObjectSet type
TLayerSet type
TIterationMethod type

GetPrimitiveCounter method

(IPCB_Board interface)
Syntax
Function GetPrimitiveCounter : IPCB_PrimitiveCounter;
Description
The IPCB_PrimitiveCounter interface gives you the means of obtaining the hole count and string count for the focussed PCB document.
Example

See also
IPCB_Board interface
PrimitiveCounter property
IPCB_PrimitiveCounter interface
GetState_SplitPlaneNets method
(IPCB_Board interface)
Syntax
Procedure GetState_SplitPlaneNets(NetsList : TStringList);
Description
This procedure retrieves the list of nets for split planes on the PCB document in a TStringList container.
Example

See also
IPCB_Board interface

HidePCBObject method

(IPCB_Board interface)
Syntax
Procedure HidePCBObject(Const PCBObject : IPCB_Primitive);
Description
This method hides the specified object on the PCB document from view.
Example

See also
IPCB_Board interface
InvertPCBObject method
ShowPCBObject method

InvertPCBObject method

(IPCB_Board interface)
Syntax
Procedure InvertPCBObject(Const PCBObject : IPCB_Primitive);
Description
This method inverts the colors of the specified object on the PCB document.
Example

See also
IPCB_Board interface
ShowPCBObject method
HidePCBObject method

LayerPositionInSet method

(IPCB_Board interface)
Syntax
Function LayerPositionInSet(ALayerSet : TLayerSet; ALayerObj : IPCB_LayerObject) : Integer;

Description
This function returns a positive value with 1 being the first layer and a higher number being the lower layer in the list. This function is useful for checking low and high layers of a layer pair.

Example

Begin PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; LayerPairs := TStringList.Create; For i := 0 To PCBBoard.DrillLayerPairsCount - 1 Do Begin PCBLayerPair := PCBBoard.LayerPair[i]; LowLayerObj := PCBBoard.LayerStack.LayerObject[PCBLayerPair.LowLayer]; HighLayerObj := PCBBoard.LayerStack.LayerObject[PCBLayerPair.HighLayer]; LowPos := PCBBoard.LayerPositionInSet(SignalLayers + InternalPlanes, LowLayerObj); HighPos := PCBBoard.LayerPositionInSet(SignalLayers + InternalPlanes, HighLayerObj); If LowPos <= HighPos Then LayerPairs.Add(LowLayerObj .Name + ' - ' + HighLayerObj.Name) Else LayerPairs.Add(HighLayerObj.Name + ' - ' + LowLayerObj .Name); End; // Format the layer pairs data string and display it. LS := ''; For i := 0 to LayerPairs.Count - 1 Do LS := LS + LayerPairs[i] + #13#10; ShowInfo('Layer Pairs:'#13#10 + LS); LayerPairs.Free; End;

See also
IPCB_Board interface
IPCB_LayerObject interface
IPCB_DrillLayerPair interface

Navigate_RedrawChangedObjectsInBoard method

(IPCB_Board interface)
Syntax
Procedure Navigate_RedrawChangedObjectsInBoard;
Description

Example

See also
IPCB_Board interface

NewUndo method

(IPCB_Board interface)
Syntax
Procedure NewUndo;
Description
This procedure creates a new undo process in the PCB editor.
Example

See also
IPCB_Board interface

RemovePCBObject method

(IPCB_Board interface)
Syntax
Procedure RemovePCBObject(PCBObject : IPCB_Primitive);
Description
This method removes the PCB object from the PCB board but it is not completely destroyed, which means it can be undone. When deleting PCB objects, basically you just collect the track object interfaces and put them in a TInterfaceList or TList Borland Delphi Container objects (which is exposed in the scripting system, but with the Server Development Kit, you need to add the Classes unit in your server project). Then with this TInterfaceList or TList object, you go thru the items one at a time, and for each item fetched, call the RemovePCBObject method from the IPCB_Board interface and call the SendMessageToRobots to remember this deleted track in the Undo system.
It is generally not a good idea to delete objects while iterating for objects within a While or Repeat loop body because it messes up the data structure that the iterator is traversing.

Bad DelphiScript Example

While Track <> Nil Do Begin OldTrack := Track; Track := Iterator.NextPCBObject; CurrentPCBBoard.RemovePCBObject(OldTrack); PCBServer.SendMessageToRobots(CurrentPCBBoard.I_ObjectAddress, c_BroadCast, PCBM_BoardRegisteration, OldTrack.I_ObjectAddress); End;

Correct DelphiScript Example

Procedure RemoveTracksOnTopLayer; var CurrentPCBBoard : IPCB_Board; Iterator : IPCB_BoardIterator; Track : IPCB_Track; TrackList : TInterfaceList; I : Integer; Begin CurrentPCBBoard := PCBServer.GetCurrentPCBBoard; If CurrentPCBBoard = Nil Then Exit; Iterator := CurrentPCBBoard.BoardIterator_Create; If Iterator = Nil Then Exit; Iterator.AddFilter_ObjectSet(MkSet(eTrackObject)); Iterator.AddFilter_LayerSet(MkSet(eTopLayer)); // store tracks in a TInterfacelist that are to be deleted later... TrackList := TInterfaceList.Create; Try Track := Iterator.FirstPCBObject; While Track <> Nil Do Begin TrackList.Add(Track); Track := Iterator.NextPCBObject; End; Finally CurrentPCBBoard.BoardIterator_Destroy(Iterator); End; Try PCBServer.PreProcess; For I := 0 to TrackList.Count \\- 1 Do Begin Track := TrackList.items[i]; CurrentPCBBoard.RemovePCBObject(Track); PCBServer.SendMessageToRobots(CurrentPCBBoard.I_ObjectAddress, c_BroadCast, PCBM_BoardRegisteration, Track.I_ObjectAddress); End; Finally PCBServer.PostProcess; TrackList.Free; End; // Refresh the PCB document. CurrentPCBBoard.ViewManager_FullUpdate; Client.SendMessage('PCB:Zoom', 'Action=Redraw' , 255, Client.CurrentView); End;

See also
IPCB_Board interface

ShowPCBObject method

(IPCB_Board interface)
Syntax
Procedure ShowPCBObject(Const PCBObject : IPCB_Primitive);
Description
This procedure makes this hidden PCB object visible on the PCB document.
Example

See also
IPCB_Board interface
InvertPCBObject method
HidePCBObject method

SetState_DocumentHasChanged method

(IPCB_Board interface)
Syntax
Procedure SetState_DocumentHasChanged;
Description
This procedure forces the document has changed flag to true denoting that the document has been marked dirty so that when you close this document, you are prompted to save this document.
Example

See also
IPCB_Board interface

SetState_Navigate_HighlightObjectList method

(IPCB_Board interface)
Syntax
Procedure SetState_Navigate_HighlightObjectList(
HighlightMethods : THighlightMethodSet;
ClearExisting : Boolean);
Description

Example

See also
IPCB_Board interface

SetState_SaveCurrentStatusOfObjectsInBoard method

(IPCB_Board interface)
Syntax
Procedure SetState_SaveCurrentStatusOfObjectsInBoard;
Description

Example

See also
IPCB_Board interface

SetState_ViewManager_FilterChanging method

(IPCB_Board interface)
Syntax
Procedure SetState_ViewManager_FilterChanging;
Description

Example

See also
IPCB_Board interface

SpatialIterator_Create method

(IPCB_Board interface)
Syntax
Function SpatialIterator_Create : IPCB_SpatialIterator;
Description
This method creates a spatial iterator which conducts a search within defined boundary on a PCB document. A spatial iterator only looks for primitive objects on a PCB document such as tracks and arcs not group objects such as dimensions and components.
Example

Iterator := Board.SpatialIterator_Create; (* Top/Bottom Layers and Arc/Track objects defined for the Spatial iterator constraints *) ASetOfLayers := MkSet(eTopLayer,eBottomLayer); ASetOfObjects := MkSet(eArcObject,eTrackObject); Iterator.AddFilter_ObjectSet(ASetOfObjects); Iterator.AddFilter_LayerSet(ASetOfLayers); Iterator.AddFilter_Area(X1,Y1,X2,Y2); (* Iterate for tracks and arcs on bottom/top layers *) PCBObject := Iterator.FirstPCBObject; While PCBObject <> 0 Do Begin PCBObject.Selected := True; PCBObject := Iterator.NextPCBObject; End; Board.SpatialIterator_Destroy(Iterator);

 

See also

IPCB_Board interface
SpatialIterator_Destroy method

SpatialIterator_Destroy method

(IPCB_Board interface)
Syntax
Procedure SpatialIterator_Destroy(Var AIterator : IPCB_SpatialIterator);
Description
This method destroys the spatial iterator object after it has finished conducting a search within a defined boundary on the PCB document. A spatial iterator only looks for primitive objects on a PCB document such as tracks and arcs not group objects such as dimensions and components.
Example

Iterator := Board.SpatialIterator_Create; (* Top/Bottom Layers and Arc/Track objects defined for the Spatial iterator constraints *) ASetOfLayers := MkSet(eTopLayer,eBottomLayer); ASetOfObjects := MkSet(eArcObject,eTrackObject); Iterator.AddFilter_ObjectSet(ASetOfObjects); Iterator.AddFilter_LayerSet(ASetOfLayers); Iterator.AddFilter_Area(X1,Y1,X2,Y2); (* Iterate for tracks and arcs on bottom/top layers *) PCBObject := Iterator.FirstPCBObject; While PCBObject <> 0 Do Begin PCBObject.Selected := True; PCBObject := Iterator.NextPCBObject; End; Board.SpatialIterator_Destroy(Iterator);

 

See also

IPCB_Board interface
SpatialIterator_Create method

UpdateBoardOutline method

(IPCB_Board interface)
Syntax
Procedure UpdateBoardOutline;
Description
This method refreshes the Board outline on the PCB document for example if you have programmatically altered the outline, it is a good time to invoke the UpdateBoardOutline method to refresh the PCB document.
Example

See also
IPCB_Board interface

ViewManager_GraphicallyInvalidatePrimitive method

(IPCB_Board interface)
Syntax
Procedure ViewManager_GraphicallyInvalidatePrimitive(PCBObject : IPCB_Primitive);
Description
This procedure forces a repaint of the targeted design object (PCBObject parameter) on the PCB document.
Example

See also
IPCB_Board interface

ViewManager_FullUpdate method

(IPCB_Board interface)
Syntax
Procedure ViewManager_FullUpdate;
Description
This method invokes a full update of all panels that are associated with the current PCB document. This method is useful if a document has been modified programmatically especially with library documents.
Example

Var CurrentLib : IPCB_Library; NewPCBLibComp : IPCB_LibComponent; NewPad : IPCB_Pad; Begin If PCBServer = Nil Then Exit; CurrentLib := PcbServer.GetCurrentPCBLibrary; If CurrentLib = Nil Then Exit; NewPCBLibComp := PCBServer.CreatePCBLibComp; NewPcbLibComp.Name := 'ANewComponent'; CurrentLib.RegisterComponent(NewPCBLibComp); CurrentLib.CurrentComponent := NewPcbLibComp; PCBServer.PreProcess; NewPad := PcbServer.PCBObjectFactory(ePadObject,eNoDimension,eCreate_Default); NewPad.X := MilsToCoord(0); NewPad.Y := MilsToCoord(0); NewPad.TopXSize := MilsToCoord(62); NewPad.TopYSize := MilsToCoord(62); NewPad.HoleSize := MilsToCoord(28); NewPad.Layer := eMultiLayer; NewPad.Name := '1'; NewPCBLibComp.AddPCBObject(NewPad); PCBServer.SendMessageToRobots(NewPCBLibComp.I_ObjectAddress,c_Broadcast,PCBM_BoardRegisteration,NewPad.I_ObjectAddress); PCBServer.SendMessageToRobots(Nil,c_Broadcast,PCBM_BoardRegisteration,NewPCBLibComp.I_ObjectAddress); PCBServer.PostProcess; CurrentLib.Board.ViewManager_FullUpdate; RefreshPCB; End;

 

See also
IPCB_Board interface

WindowBoundingRectangle method

(IPCB_Board interface)
Syntax
Function WindowBoundingRectangle : TCoordRect;
Description
This function returns the coordinates of the bounds of a PCB window.
Example

See also
IPCB_Board interface

Properties

AutomaticSplitPlanes property

(IPCB_Board interface)
Syntax
Property AutomaticSplitPlanes : Boolean Read GetState_AutomaticSplitPlanes Write SetState_AutomaticSplitPlanes;
Description
The AutomaticSplitPlanes property returns you the boolean value whether the split planes are system generated automatically or not. This property is implemented by its GetState_AutomaticSplitPlanes and SetState_AutomaticSplitPlanes methods.
Example

See also
IPCB_Board interface

BigVisibleGridSize property

(IPCB_Board interface)
Syntax
BigVisibleGridSize : TReal Read GetState_BigVisibleGridSize Write SetState_BigVisibleGridSize;
Description
This property retrieves or sets the Big Visible Grid Size in TReal type. This Grid Size is used for reference purposes and there are two visible grids.
Example

See also
IPCB_Board interface
VisibleGridSize property

BigVisibleGridUnit property

(IPCB_Board interface)
Syntax
Property BigVisibleGridUnit : TUnit Read GetState_BigVisibleGridUnit Write SetState_BigVisibleGridUnit;
Description
This property retrieves or sets the big visible grid's measurement units in Imperial or Metric units. There are two visible grids to use for reference purposes.
Example

See also
IPCB_Board interface
VisibleGridUnit property
TUnit type

BoardOutline property

(IPCB_Board interface)
Syntax
Property BoardOutline : IPCB_BoardOutline Read GetState_BoardOutline;
Description
The Board Outline represents the board outline which encompasses a board design on a PCB document. The board outline is represented by the IPCB_BoardOutline interface and inherited from the IPCB_Polygon interface because the Board Outline is composed of vertices (tracks and arcs only).
Example

Var PCB_Board : IPCB_Board; BR : TCoordRect; Begin PCB_Board := PCBServer.GetCurrentPCBBoard; If PCB_Board = Nil Then Exit; If PCB_Board.IsLibrary Then Exit; PCB_Board.BoardOutline.Invalidate; PCB_Board.BoardOutline.Rebuild; PCB_Board.BoardOutline.Validate; BR := PCB_Board.BoardOutline.BoundingRectangle; // refresh board outline PCB_Board.UdateBoardOutline; End;

 

See also

IPCB_Board interface
IPCB_BoardOutline interface

ComponentGridSize property

(IPCB_Board interface)
Syntax
Property ComponentGridSize : TDouble Read GetState_ComponentGridSize Write SetState_ComponentGridSize;
Description
This property represents the component grid size for components to be accurately placed on. This component grid size sets the X and Y values simultaneously. If you wish to define different X and Y grid sizes, then use the ComponentGridSizeX and ComponentGridSizeY properties.
Example

See also
IPCB_Board interface
ComponentGridSizeX property
ComponentGridSizeY property
TDouble type

ComponentGridSizeX property

(IPCB_Board interface)
Syntax
Property ComponentGridSizeX : TDouble Read GetState_ComponentGridSizeX Write SetState_ComponentGridSizeX;
Description
This property represents the component grid size for components to be accurately placed on. To define different X and Y grid sizes, use the ComponentGridSizeX and ComponentGridSizeY properties, otherwise to set the same values for the component grid sizes X and Y simultaneously.
Example

See also
IPCB_Board interface
ComponentGridSize
ComponentGridSizeY

ComponentGridSizeY property

(IPCB_Board interface)
Syntax
Property ComponentGridSizeY : TDouble Read GetState_ComponentGridSizeY Write SetState_ComponentGridSizeY;
Description
This property represents the component grid size for components to be accurately placed on. To define different X and Y grid sizes, use the ComponentGridSizeX and ComponentGridSizeY properties, otherwise to set the same values for the component grid sizes X and Y simultaneously.
Example

See also
IPCB_Board interface

CurrentLayer property

(IPCB_Board interface)
Syntax
Property CurrentLayer : TLayer Read GetState_CurrentLayer;
Description
This property denotes the current PCB layer being displayed in the PCB workspace in Altium Designer.
Example

See also
IPCB_Board interface

DisplayUnit property

(IPCB_Board interface)
Syntax
Property DisplayUnit : TUnit Read GetState_DisplayUnit Write SetState_DisplayUnit;
Description
This property retrieves or sets the measurement units for the PCB document display purposes in Imperial or Metric units.
Example

Var Board : IPCB_Board; Begin Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; ShowMessage('Board Filename =' + Board.FileName + #13 + 'Board Units = ' + UnitToString(Board.DisplayUnit)); End;

 

See also
IPCB_Board interface
UnitToString function

DrawDotGrid property

(IPCB_Board interface)
Syntax
Property DrawDotGrid : Boolean Read GetState_DrawDotGrid Write SetState_DrawDotGrid;
Description
This property denotes whether the grid has dotted or continuous lines.
Example

See also
IPCB_Board interface

DrillLayersPairsCount property

(IPCB_Board interface)
Syntax
Property DrillLayerPairsCount : Integer Read GetState_DrillLayerPairsCount;
Description
This property returns the number of drill layer pairs for the board. A drill layer pair is represented by the IPCB_DrillLayerPair interface.

Example

Var PCBBoard : IPCB_Board; i : Integer; LayerPairs : TStringList; PCBLayerPair : IPCB_DrillLayerPair; LowLayerObj : IPCB_LayerObject; HighLayerObj : IPCB_LayerObject; LowPos : Integer; HighPos : Integer; LS : String; Begin PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; For i := 0 To PCBBoard.DrillLayerPairsCount - 1 Do Begin PCBLayerPair := PCBBoard.LayerPair[i]; LowLayerObj := PCBBoard.LayerStack.LayerObject[PCBLayerPair.LowLayer]; HighLayerObj := PCBBoard.LayerStack.LayerObject[PCBLayerPair.HighLayer]; // do what you want with the LowLayerObj and HighLayerObj objects End; End;

See also
IPCB_Board interface
LayerPair property
IPCB_DrillLayerPair interface

FileName property

(IPCB_Board interface)
Syntax
Property FileName : TPCBString Read GetState_FileName;
Description
The FileName property denotes the filename of the PCB document that the IPCB_Board interface is associated with. The Filename property is read only, which means you can retrieve the filename string only.
Example

Var Board : IPCB_Board; Begin Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; ShowMessage('Board Filename =' + Board.FileName + #13 + 'Board Units = ' + UnitToString(Board.DisplayUnit)); End;

See also
IPCB_Board interface

InternalPlane1NetName property

(IPCB_Board interface)
Syntax
Property InternalPlane1NetName : TPCBString Read GetState_InternalPlane1NetName Write SetState_InternalPlane1NetName;
Description
This property represents the Internal Plane 1 Netname (for P99SE and earlier products).
Example

See also
IPCB_Board interface
IPCB_LayerStack interface.

InternalPlane2NetName property

(IPCB_Board interface)
Syntax
Property InternalPlane2NetName : TPCBString Read GetState_InternalPlane2NetName Write SetState_InternalPlane2NetName;
Description
This property represents the Internal Plane 2 Netname (for P99SE and earlier products).
Example

See also
IPCB_Board interface
IPCB_LayerStack interface.

InternalPlane3NetName property

(IPCB_Board interface)
Syntax
Property InternalPlane3NetName : TPCBString Read GetState_InternalPlane3NetName Write SetState_InternalPlane3NetName;
Description
This property represents the Internal Plane 3 Netname (for P99SE and earlier products).
Example

See also
IPCB_Board interface
IPCB_LayerStack interface.

InternalPlane4NetName property

(IPCB_Board interface)
Syntax
Property InternalPlane4NetName : TPCBString Read GetState_InternalPlane4NetName Write SetState_InternalPlane4NetName;
Description
This property represents the Internal Plane 1 Netname (for P99SE and earlier products).
Example

See also
IPCB_Board interface
IPCB_LayerStack interface.

InternalPlaneNetName property

(IPCB_Board interface)
Syntax
Property InternalPlaneNetName TLayer : TPCBString Read GetState_InternalPlaneNetName Write SetState_InternalPlaneNetName;
Description
This property returns or sets the net name for the targetted internal plane.
Example

See also
IPCB_Board interface
TLayer type

LayerColor property

(IPCB_Board interface)
Syntax
Property LayerColor TLayer : TColorRef Read GetState_LayerColor;
Description
This property returns the layer color of TColorRef type. This type is defined in the Windows.pas which is part of the Borland Delphi Run-Time Library.
Example

See also
IPCB_Board interface
TColorRef type

LayerIsDisplayed property

(IPCB_Board interface)
Syntax
Property LayerIsDisplayed TLayer : Boolean Read GetState_LayerIsDisplayed Write SetState_LayerIsDisplayed;
Description
The LayerIsDisplayed property controls the display of layers for the PCB document. You can fetch or set the

Example

PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; // Check for each signal layer for used/display setting For Layer := eTopLayer to eMultiLayer Do If PCBBoard.LayerIsUsed[Layer] Then If PCBBoard.LayerIsDisplayed[Layer] Then \\ do something

See also
IPCB_Board interface

LayerIsUsed property

(IPCB_Board interface)
Syntax
Property LayerIsUsed TLayer : Boolean Read GetState_LayerIsUsed Write SetState_LayerIsUsed;

Description
This property retrieves or sets the boolean value for whether the layer is used by primitives or not. Normally when a layer has primitives (design objects) on it, the layer is used.

Example

PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; // Check for each signal layer for used/display setting For Layer := eTopLayer to eMultiLayer Do If PCBBoard.LayerIsUsed[Layer] Then If PCBBoard.LayerIsDisplayed[Layer] Then \\ do something

See also
IPCB_Board interface

LayerPair property

(IPCB_Board interface)
Syntax
Property LayerPair Integer : IPCB_DrillLayerPair Read GetState_LayerPair;

Description
This property returns you the layer pair associated with the IPCB_DrillLayerPair interface. A drill layer pair has two drill layers.

Example

Var PCBBoard : IPCB_Board; i : Integer; LayerPairs : TStringList; PCBLayerPair : IPCB_DrillLayerPair; LowLayerObj : IPCB_LayerObject; HighLayerObj : IPCB_LayerObject; LowPos : Integer; HighPos : Integer; LS : String; Begin PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; // Show the Current Layer for the PCB document. ShowInfo('Current Layer: ' + Layer2String(PCBBoard.CurrentLayer)); LayerPairs := TStringList.Create; For i := 0 To PCBBoard.DrillLayerPairsCount - 1 Do Begin PCBLayerPair := PCBBoard.LayerPair[i]; LowLayerObj := PCBBoard.LayerStack.LayerObject[PCBLayerPair.LowLayer]; HighLayerObj := PCBBoard.LayerStack.LayerObject[PCBLayerPair.HighLayer]; LowPos := PCBBoard.LayerPositionInSet(SignalLayers + InternalPlanes, LowLayerObj); HighPos := PCBBoard.LayerPositionInSet(SignalLayers + InternalPlanes, HighLayerObj); If LowPos <= HighPos Then LayerPairs.Add(LowLayerObj .Name + ' - ' + HighLayerObj.Name) Else LayerPairs.Add(HighLayerObj.Name + ' - ' + LowLayerObj .Name); End; // Display layer pairs. LS := ''; For i := 0 to LayerPairs.Count - 1 Do LS := LS + LayerPairs[i] + #13#10; ShowInfo('Layer Pairs:'#13#10 + LS); LayerPairs.Free; End;

See also
IPCB_Board interface

LayerStack property

(IPCB_Board interface)
Syntax
Property LayerStack : IPCB_LayerStack Read GetState_LayerStack;

Description
The layer stack property fetches the IPCB_LayerStack interface for the current PCB document. The Layer stack only stores copper layers (signal and internal planes).

Example

Var PCBBoard : IPCB_Board; TheLayerStack : IPCB_LayerStack; i : Integer; LayerObj : IPCB_LayerObject; LS : String; Begin PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; // Note that the Layer stack only stores existing copper based layers. // But you can use the LayerObject property to fetch all layers. TheLayerStack := PCBBoard.LayerStack; If TheLayerStack = Nil Then Exit; LS := ''; LayerObj := TheLayerStack.FirstLayer; Repeat LS := LS + Layer2String(LayerObj.LayerID) + #13#10; LayerObj := TheLayerStack.NextLayer(LayerObj); Until LayerObj = Nil; ShowInfo('The Layer Stack has :'#13#10 + LS); End;

See also
IPCB_LayerStack interface
IPCB_LayerObject interface
IPCB_Board interface

MechanicalPairs property

(IPCB_Board interface)
Syntax
Property MechanicalPairs : IPCB_MechanicalLayerPairs Read GetState_MechanicalPairs;
Description
There are 16 general purpose mechanical layers for defining the board layout, placing dimensions on, including fabrication details on, or any other mechanical details the design requires.
The purpose of the IPCB_MechanicalLayerPairs Interface is to provide which Mechanical layers are paired to one another.
When a component incorporates objects on one or more Mechanical layers which have been paired, the Layer property of those objects changes when the Layer property of the component is toggled (between the Top and Bottom layers), just like objects on the non-Mechanical layers which have always been paired to one another, along with the Top and Bottom (copper) layers, the Top and Bottom Overlay layers, the Top and Bottom Paste Mask layers, and the Top and Bottom Solder Mask layers.
Example

See also
IPCB_Board interface
IPCB_MechanicalPairs interface

PCBSheet property

(IPCB_Board interface)
Syntax
Property PCBSheet : IPCB_Sheet Read GetState_PCBSheet;
Description
This property returns the IPCB_Sheet interface which is represented by the sheet workspace. A sheet encapsulates the sheet borders, the fabrication and assembly information, and the board outline.
Example

See also
IPCB_Board interface
IPCB_Sheet interface

PCBWindow property

(IPCB_Board interface)
Syntax
Property PCBWindow : HWND Read GetState_Window;

Description
This property returns the raw Windows handle for a window handle of a PCB document in Altium Designer.

Example

See also
IPCB_Board interface

SelectecObjectCount property

(IPCB_Board interface)
Syntax
Property SelectecObjectCount : Integer Read GetState_SelectecObjectCount;
Description
This property represents the number of selected objects found on the PCB document. This is to be used in conjunction with the SelectecObject property.
Example

See also
IPCB_Board interface
SelectecObject property

SelectecObject property

(IPCB_Board interface)
Syntax
Property SelectecObject [I : Integer] : IPCB_Primitive Read GetState_SelectecObject;
Description
This property represents the indexed selected object found on the PCB document. This is to be used in conjunction with the SelectecObjectCount property.
Example

See also
IPCB_Board interface

SelectecObjectCount property

PrimitiveCounter method
(IPCB_Board interface)
Syntax
Property PrimitiveCounter : IPCB_PrimitiveCounter Read GetPrimitiveCounter;
Description
The IPCB_PrimitiveCounter interface gives you the means of obtaining the object count, hole count and string count for the focussed PCB document via the IPCB_Board's PrimitiveCounter property.
Example

See also
IPCB_Board interface
GetPrimitiveCounter method
IPCB_PrimitiveCounter interface

SnapGridSizeX property

(IPCB_Board interface)
Syntax
Property SnapGridSizeX : TDouble Read GetState_SnapGridSizeX Write SetState_SnapGridSizeX;
Description
This property retrieves or sets the Snap Grid size X value. To set both X and Y values simultaneously for the Snap Grid, use the SnapGridSize property.
Example

See also
IPCB_Board interface
SnapGridSizeY property
SnapGridSize property

SnapGridSizeY property

(IPCB_Board interface)
Syntax
Property SnapGridSizeY : TDouble Read GetState_SnapGridSizeY Write SetState_SnapGridSizeY;
Description
This property retrieves or sets the Snap Grid size Y value. To set both X and Y values simultaneously for the Snap Grid, use the SnapGridSize property.
Example

See also
IPCB_Board interface
SnapGridSizeX property
SnapGridSize property

SnapGridSize property

(IPCB_Board interface)
Syntax
Property SnapGridSize : TDouble Read GetState_SnapGridSize Write SetState_SnapGridSize;
Description
The SnapGridSize property sets the X and Y values for the Snap Grid simultaneously. If you want to have different X and Y values for this snap grid, use the SnapGridSizeX and SnapGridSizeY properties.
Example

See also
IPCB_Board interface
SnapGridSizeX property
SnapGridSizeY property

SnapGridUnit property

(IPCB_Board interface)
Syntax
Property SnapGridUnit : TUnit Read GetState_SnapGridUnit Write SetState_SnapGridUnit;
Description
The SnapGridUnit property retrieves or sets the measurement unit for the Snap Grid Unit. It can be in Imperial or Metric units.
Example

See also
IPCB_Board interface
TUnit type

TrackGridSize property

(IPCB_Board interface)
Syntax
Property TrackGridSize : TDouble Read GetState_TrackGridSize Write SetState_TrackGridSize;
Description
This property retrieves or sets the track grid size in both X and Y directions simultaneously.
Example

See also
IPCB_Board interface
ViaGridSize property

ViaGridSize property

(IPCB_Board interface)
Syntax
Property ViaGridSize : TDouble Read GetState_ViaGridSize Write SetState_ViaGridSize;
Description
This property retrieves or sets the via grid size in both X and Y directions simultaneously.
Example

See also
IPCB_Board interface
TrackGridSize property

VisibleGridSize property

(IPCB_Board interface)
Syntax
Property VisibleGridSize : TReal Read GetState_VisibleGridSize Write SetState_VisibleGridSize;
Description
This property retrieves or sets the Visible Grid Size in TReal type. This Grid Size is used for reference purposes and there are two visible grids.
Example

See also
IPCB_Board interface
BigVisibleGridSize property

VisibleGridUnit property

(IPCB_Board interface)
Syntax
Property VisibleGridUnit : TUnit Read GetState_VisibleGridUnit Write SetState_VisibleGridUnit;
Description
This property retrieves or sets the big visible grid's measurement units in Imperial or Metric units. There are two visible grids to use for reference purposes.
Example

See also
IPCB_Board interface
BigVisibleGridUnit interface
TUnit type

XOrigin property

(IPCB_Board interface)
Syntax
Property XOrigin : TCoord Read GetState_XOrigin Write SetState_XOrigin;
Description
This property sets or retrieves the X coordinate of the absolute origin of the board.
Example
See also
IPCB_Board interface

XCursor property

(IPCB_Board interface)
Syntax
Property XCursor : TCoord Read GetState_XCursor Write SetState_XCursor;
Description
This property retrieves or sets the x coordinate of the cursor of the latest mouse click on the PCB document.
Example

See also
IPCB_Board interface

YCursor property

(IPCB_Board interface)
Syntax
Property YCursor : TCoord Read GetState_YCursor Write SetState_YCursor;
Description
This property retrieves or sets the Y coordinate of the cursor of the latest mouse click on the PCB document.
Example

See also
IPCB_Board interface

YOrigin property

(IPCB_Board interface)
Syntax
Property YOrigin : TCoord Read GetState_YOrigin Write SetState_YOrigin;
Description
This property sets or retrieves the Y coordinate of the absolute origin of the board.
Example

See also
IPCB_Board interface

ECOOptions property

(IPCB_Board interface)
Syntax
Property ECOOptions : IPCB_ECOOptions Read GetState_ECOOptions;
Description
This property returns you the IPCB_ECOOptions interface which represents the Options for the Engineering Order Change facility in the PCB editor.
Example

See also
IPCB_Board interface
IPCB_ECOOptions interface

GerberOptions property

(IPCB_Board interface)
Syntax
Property GerberOptions : IPCB_GerberOptions Read GetState_GerberOptions;
Description
This property returns you the IPCB_GerberOptions interface which represents the Options for the Gerbers facility in the PCB editor.
Example

See also
IPCB_Board interface
IPCB_GerberOptions interface

PlacerOptions property

(IPCB_Board interface)
Syntax
Property PlacerOptions : IPCB_AdvancedPlacerOptions Read GetState_PlacerOptions;
Description
This property returns you the IPCB_PlacerOptions interface which represents the Options for the Placement facility in the PCB editor.
Example

See also
IPCB_Board interface
IPCB_PlacerOptions interface

PrinterOptions property

(IPCB_Board interface)
Syntax
Property PrinterOptions : IPCB_PrinterOptions Read GetState_PrinterOptions;
Description
This property returns you the IPCB_PrinterOptions interface which represents the Options for the Printer setup facility in the PCB editor.
Example

See also
IPCB_Board interface
IPCB_PrinterOptions interface

OutputOptions property

(IPCB_Board interface)
Syntax
Property OutputOptions : IPCB_OutputOptions Read GetState_OutputOptions;
Description
This property returns you the IPCB_OutputOptions interface which represents the Options for the Output facility in the PCB editor.
Example

See also
IPCB_Board interface
IPCB_OutputOptions interface

IPCB_Library interface

Overview
The IPCB_Library interface represents the library document. A library document has a list of components (footprints). The component in focus in the PCB library is always the current component. This current component is represented by the IPCB_LibComponent interface.
To obtain the settings of the library document, you obtain the IPCB_Board interface, to obtain the primitives of a component (footprint), you obtain the IPCB_LibComponent interface via the Library Iterator interface.
There is a three way relationship: the IPCB_Board , the IPCB_LibComponent and the IPCB_Library interfaces that all work together for a PCB library document.

The IPCB_Library interface is a standalone interface.

IPCB_Library
methods
GetState_CurrentComponent
SetState_CurrentComponent
GetState_Board
RegisterComponent
DeRegisterComponent
GetUniqueCompName
CreateNewComponent
RemoveComponent
GetComponentByName
SetBoardToComponentByName
Navigate_FirstComponent
SetCurrentComponentReference
LibraryIterator_Create
LibraryIterator_Destroy

IPCB_Library
properties
CurrentComponent
Board

Example

Var CurrentLib : IPCB_Library; NewPCBLibComp : IPCB_LibComponent; Begin If PCBServer = Nil Then Exit; CurrentLib := PcbServer.GetCurrentPCBLibrary; If CurrentLib = Nil Then Exit; // ditto End;

 

See also

IPCB_ServerInterface interface
IPCB_LibComponent interface
IPCB_LibraryIterator interface

GetState and SetState Methods

GetState_Board method
(IPCB_Library interface)
Syntax
Function GetState_Board : IPCB_Board;
Description
This function retrieves the IPCB_Board interface where the current component (footprint) is in. This IPCB_Board interface also contains the system settings such as Snap Grid, Visible and Big Visible Grid Units and Output Options for the PCB library document.
There is a three way relationship: the IPCB_Board , the IPCB_LibComponent and the IPCB_Library interfaces that all work together for the PCB library document.
Example

See also
IPCB_Library interface


GetState_CurrentComponent method
(IPCB_Library interface)
Syntax
Function GetState_CurrentComponent : IPCB_LibComponent;
Description
This function fetches the current component that is in focus in the PCB library. A footprint (component) in the library is represented by the IPCB_LibComponent interface. A PCB Library document is represented differently in regards to a PCB document; a pcb library is composed of footprints and each footprint has its own "window".
Example

See also
IPCB_Library interface
IPCB_Group interface

SetState_CurrentComponent method
(IPCB_Library interface)
Syntax
Procedure SetState_CurrentComponent (Const Component : IPcb_LibComponent);
Description
This procedure sets an existing component from the PCB library as the current component (in focus). Basically a component that is currently in focus in the library is the current component.
Note a footprint (component) in the library is represented by the IPCB_LibComponent interface.
Example

See also
IPCB_Library interface

Methods

DeRegisterComponent method
(IPCB_Library interface)
Syntax
Function DeRegisterComponent(Component : IPcb_LibComponent) : Boolean;
Description
This method de-registers this component from the PCB library. That is, the library does not recognize this component after it has been de-registered.
Example

See also
IPCB_Library interface
IPCB_LibComponent interface

GetUniqueCompName method
(IPCB_Library interface)
Syntax
Function GetUniqueCompName (Const ATestCompName : TPCBString ) : TPCBString;
Description
This function returns you the unique component name and if the supplied component name parameter is taken, this parameter is modified to guarantee its uniqueness.
Example

See also
IPCB_Library interface
IPCB_LibComponent interface

CreateNewComponent method
(IPCB_Library interface)
Syntax
Function CreateNewComponent : IPCB_LibComponent;
Description
This function creates a new component and it is represented by the IPCB_LibComponent interface. This is equivalent to the CreatePCBLibComp method from the IPCB_ServerInterface interface.
Example

See also
IPCB_Library interface
IPCB_LibComponent interface

RemoveComponent method
(IPCB_Library interface)
Syntax
Procedure RemoveComponent (Var AComponent : IPCB_LibComponent);
Description
This procedure removes a component from the current library.
Example

See also
IPCB_Library interface
IPCB_LibComponent interface

SetBoardToComponentByName method
(IPCB_Library interface)
Syntax
Function SetBoardToComponentByName(Const ACompName : TPCBString) : Boolean;
Description
This function sets the current library to the specified component by its component name string. If it is successful, a true value is returned.
Example

See also
IPCB_Library interface
IPCB_LibComponent interface

Navigate_FirstComponent method
(IPCB_Library interface)
Syntax
Procedure Navigate_FirstComponent;
Description
This procedure forces the library to navigate to the first component in the library and set the focus to it.
Example

See also
IPCB_Library interface
IPCB_LibComponent interface

SetCurrentComponentReference method
(IPCB_Library interface)
Syntax
Procedure SetCurrentComponentReference (AX : TCoord;
AY : TCoord);
Description
This procedure sets the component reference of the currently focused component as the center.
Example

See also
IPCB_Library interface
IPCB_LibComponent interface

GetComponentByName method
(IPCB_Library interface)
Syntax
Function GetComponentByName (Const CompName : TPCBString ) : IPCB_LibComponent;
Description
This function returns you the IPCB_LibComponent of a PCB component (footprint) if the CompName string.
Example

See also
IPCB_Library interface
IPCB_LibComponent interface

LibraryIterator_Create method
(IPCB_Library interface)
Syntax
Function LibraryIterator_Create : IPCB_LibraryIterator;
Description
This function creates a library iterator that fetches footprints in a PCB library. Each footprint fetched by the iterator is a IPCB_LibComponent interface which is inherited by the IPCB_Group interface.

DelphiScript Example

Var CurrentLib : IPCB_Library; FootprintIterator : IPCB_LibraryIterator; Footprint : IPCB_LibComponent; Begin CurrentLib := PCBServer.GetCurrentPCBLibrary; If CurrentLib = Nil Then Begin ShowMessage('This is not a PCB Library document'); Exit; End; // For each page of library is a footprint FootprintIterator := CurrentLib.LibraryIterator_Create; FootprintIterator.SetState_FilterAll; Try // Within each footprint page, fetch primitives of the footprint // A footprint is a IPCB_LibComponent inherited from // the IPCB_Group. A container object that stores primitives. Footprint := FootprintIterator.FirstPCBObject; While Footprint <> Nil Do Begin // do what you want with the footprint Footprint := FootprintIterator.NextPCBObject; End; Finally CurrentLib.LibraryIterator_Destroy(FootprintIterator); End; End;

See also
IPCB_LibraryIterator interface
IPCB_Library interface
IPCB_LibComponent interface

LibraryIterator_Destroy method
(IPCB_Library interface)
Syntax
Procedure LibraryIterator_Destroy(Var AIterator : IPCB_LibraryIterator);
Description
This LibraryIterator_Destroy method destroys the library iterator after it was used in iterating for footprints in a PCB library document.

Example

Var CurrentLib : IPCB_Library; FootprintIterator : IPCB_LibraryIterator; Footprint : IPCB_LibComponent; Begin CurrentLib := PCBServer.GetCurrentPCBLibrary; If CurrentLib = Nil Then Begin ShowMessage('This is not a PCB Library document'); Exit; End; // For each page of library is a footprint FootprintIterator := CurrentLib.LibraryIterator_Create; FootprintIterator.SetState_FilterAll; Try // Within each page, fetch primitives of the footprint // A footprint is a IPCB_LibComponent inherited from // IPCB_Group which is a container object that stores primitives. Footprint := FootprintIterator.FirstPCBObject; While Footprint <> Nil Do Begin // do what you want with the footprint Footprint := FootprintIterator.NextPCBObject; End; Finally CurrentLib.LibraryIterator_Destroy(FootprintIterator); End; End;

See also
IPCB_Library interface
IPCB_LibComponent interface
IPCB_LibraryIterator interface

RegisterComponent method
(IPCB_Library interface)
Syntax
Function RegisterComponent (Component : IPcb_LibComponent) : Boolean;
Description
The RegisterComponent method registers the new footprint in the PCB library document, so that the PCB system is aware of this new footprint.
For example when creating a new footprint programmatically, this footprint needs to be registered in the PCB library first before setting it to be the current component.

Example

Var CurrentLib : IPCB_Library; NewPCBLibComp : IPCB_LibComponent; NewPad : IPCB_Pad; Begin If PCBServer = Nil Then Exit; CurrentLib := PcbServer.GetCurrentPCBLibrary; If CurrentLib = Nil Then Exit; NewPCBLibComp := PCBServer.CreatePCBLibComp; NewPcbLibComp.Name := 'ANewComponent'; CurrentLib.RegisterComponent(NewPCBLibComp); CurrentLib.CurrentComponent := NewPcbLibComp; // ditto End;

See also
IPCB_Library interface
IPCB_LibComponent interface

Properties

Board property

(IPCB_Library interface)
Syntax
Property Board : IPCB_Board Read GetState_Board;

Description
The property represents the board that the current component is residing on in the PCB library document. This IPCB_Board interface also contains the system settings such as Snap Grid, Visible and Big Visible Grid Units and Output Options for the PCB library document.
The read only Board property is supported by the GetState_Board method.
There is a three way relationship: the IPCB_Board , the IPCB_LibComponent and the IPCB_Library interfaces that all work together for a PCB library document.

Example

See also
IPCB_Library interface

CurrentComponent property
(IPCB_Library interface)
Syntax
Property CurrentComponent : IPCB_LibComponent Read GetState_CurrentComponent Write SetState_CurrentComponent;
Description
This property determines the current component (footprint) that is in focus or displayed in the PCB library document in Altium Designer.
When creating a new footprint programmatically, this footprint needs to be registered in the PCB library first before setting it to be the current component.
This CurrentComponent property is supported by GetState_CurrentComponent and SetState_CurrentComponent methods.

Example

Var CurrentLib : IPCB_Library; NewPCBLibComp : IPCB_LibComponent; NewPad : IPCB_Pad; Begin If PCBServer = Nil Then Exit; CurrentLib := PcbServer.GetCurrentPCBLibrary; If CurrentLib = Nil Then Exit; NewPCBLibComp := PCBServer.CreatePCBLibComp; NewPcbLibComp.Name := 'ANewComponent'; CurrentLib.RegisterComponent(NewPCBLibComp); CurrentLib.CurrentComponent := NewPcbLibComp; // ditto End;

See also
IPCB_Library interface
IPCB_LibComponent interface

IPCB_Sheet interface

Overview
The IPCB_Sheet interface represents the background workspace for the PCB document and can include fabrication and assembly documentation as well as the board outline. The IPCB_Board interface has the IPCB_Sheet interface as an aggregation interface because a sheet is part of the PCB document.

Notes
The sheet behind the PCB can be shown or not.
The coordinates of the PCB sheet can be defined programmatically.

IPCB_Sheet
methods
IPCB_Sheet
properties


I_ObjectAddress


SheetX
SheetY
SheetWidth
SheetHeight
ShowSheet
LockSheet

See also
IPCB_Board

Methods

I_ObjectAddress method
(IPCB_AbstractIterator, IPCB_BoardIterator, IPCB_SpatialIterator, IPCB_GroupIterator, IPCB_Sheet)
Syntax
Function I_ObjectAddress : TPCBObjectHandle;
Description
The I_ObjectAddress property retrieves the pointer to the iterator object. This property is useful for situations where you need to have references to objects (not to object interfaces) and store them in a TList container for example.

See also
IPCB_Sheet interface

Properties

SheetHeight property
(IPCB_Board interface)
Syntax
Property SheetHeight : TCoord Read GetState_SheetHeight Write SetState_SheetHeight;
Description
The SheetHeight property represents the sheet's height.
Example

See also
IPCB_Sheet interface

SheetWidth property
(IPCB_Sheet interface)
Syntax
Property SheetWidth : TCoord Read GetState_SheetWidth Write SetState_SheetWidth;
Description
The SheetWidth property represents the width of the sheet.
Example

See also
IPCB_Sheet interface

SheetX property
(IPCB_Sheet interface)
Syntax
Property SheetX : TCoord Read GetState_SheetX Write SetState_SheetX;
Description
The SheetX property represents the X coordinate of the sheet.
Example

See also
IPCB_Sheet interface

SheetY property
(IPCB_Sheet interface)
Syntax
Property SheetY : TCoord Read GetState_SheetY Write SetState_SheetY;
Description
The SheetY property represents the Y coordinate of the sheet.
Example

See also
IPCB_Sheet interface

ShowSheet method
(IPCB_Sheet interface)
Syntax
Property ShowSheet : Boolean Read GetState_ShowSheet Write SetState_ShowSheet;
Description
This property retrieves or sets the boolean value. The Sheet property represents the bounds where a board outline and assembly / fabrication details are included within.

Example

Function UnitToString(U : TUnit) : TPCBString; Begin Result := ''; Case U of eImperial : Result := 'Imperial (mil)'; eMetric : Result := 'Metric (mm)'; End; End; {..........................................................................} {..........................................................................} Function BoolToString(B : Boolean) : TPCBString; Begin Result := 'False'; If B Then Result := True; End; {..........................................................................} {..........................................................................} Procedure Query_Board; Var Board : IPCB_Board; LibraryExists : TPCBString; AShowSheet : TPCBString; ALockSheet : TPCBString; Begin Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; LibraryExists := BoolToString(Board.IsLibrary); AShowSheet := BoolToString(Board.PCBSheet.ShowSheet); ALockSheet := BoolToString(Board.PCBSheet.LockSheet); ShowMessage( 'Board Handle = ' + IntToStr (Board.I_ObjectAddress) + #13 + 'Window Handle = ' + IntToStr (Board.PCBWindow) + #13 + 'Board Filename =' + Board.FileName + #13 + 'Is a Library = ' + LibraryExists + #13 + 'Origin X = ' + IntToStr (Board.XOrigin) + #13 + 'Origin Y = ' + IntToStr (Board.YOrigin) + #13 + 'Board Units = ' + UnitToString(Board.DisplayUnit) + #13 + 'Current layer = ' + Layer2String(Board.CurrentLayer) + #13 + 'Sheet.X = ' + IntToStr (Board.PCBSheet.SheetX) + #13 + 'Sheet.Y = ' + IntToStr (Board.PCBSheet.SheetY) + #13 + 'Sheet.Height = ' + IntToStr (Board.PCBSheet.SheetHeight) + #13 + 'Sheet.Width = ' + IntToStr (Board.PCBSheet.SheetWidth) 'Sheet is shown = ' + AShowSheet + #13 + 'Sheet is locked = ' + ALockSheet ); End;

See also
IPCB_Sheet interface

LockSheet method
(IPCB_Sheet interface)
Syntax
Property LockSheet : Boolean Read GetState_LockSheet Write SetState_LockSheet;
Description
The LockSheet property represents whether the objects on a mechanical layer linked to the sheet is locked or not.
Example

See also
IPCB_Sheet interface

IPCB_LayerStack

Overview
The IPCB_LayerStack interface represents the layer stack for the current PCB document. This Layer Stack interface is a property within in the IPCB_Board interface.
Strictly speaking, the IPCB_LayerStack interface represents the layer stack and therefore only has copper based layers such as top, mid1-30, bottom layers and internal planes. However you can use the LayerObject property with the IPCB_Board parameter passed in to obtain any PCB layer for the PCB document.
Iterating copper layers within the Layer Stack
To query for existing copper layers (signal layers and internal players) within the layer stack, you can use the FirstLayer and NextLayer properties of the IPCB_LayerStack interface to iterate for such layers.
Notes
Each layer can be represented as a IPCB_LayerObject, IPCB_InternalPlane, IPCB_DrillLayerPair or IPCB_MechanicalLayerPairs interfaces.
A layer can have dielectric properties which is represented by a IPCB_DielectricObject interface.
To have access to other layers of the PCB document, use the LayerObject property of the IPCB_LayerStack interface.

IPCB_LayerStack
methods
FirstLayer
NextLayer
PreviousLayer
LastLayer
InsertLayer
LastInternalPlane
FirstAvailableSignalLayer
FirstAvailableInternalPlane
SignalLayerCount

IPCB_LayerStack
properties
Board
LayerObject
DielectricTop
DielectricBottom
ShowDielectricTop
ShowDielectricBottom

See also
Using PCB Layers
Using the PCB Layer Stack
IPCB_LayerObject interface
IPCB_InternalPlane interface
IPCB_Board interface
IPCB_DielectricObject interface
QueryLayerStack and QueryMechLayers script in the * *Example s\Scripts\Delphiscript\PCB folder

Methods

FirstLayer method
(IPCB_LayerStack interface)
Syntax
Function FirstLayer : IPCB_LayerObject;
Description
The Firstlayer property fetches the first layer stored in the layer stack for the PCB document. To fetch the next layer in the layer stack, invoke the NextLayer property. Notice that the layer stack only stores signal and internal (copper based) layers.
Example

Var PCBBoard : IPCB_Board; TheLayerStack : IPCB_LayerStack; i : Integer; LayerObj : IPCB_LayerObject; LS : String; Begin PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; TheLayerStack := PCBBoard.LayerStack; If TheLayerStack = Nil Then Exit; LS := ''; LayerObj := TheLayerStack.FirstLayer; Repeat LS := LS + Layer2String(LayerObj.LayerID) + #13#10; LayerObj := TheLayerStack.NextLayer(LayerObj); Until LayerObj = Nil; ShowInfo('The Layer Stack has :'#13#10 + LS); End;

 

See also

IPCB_LayerStack interface

FirstAvailableInternalPlane method
(IPCB_LayerStack interface)
Syntax
Function FirstAvailableInternalPlane : IPCB_InternalPlane;
Description
This function retrieves the first available internal plane object interface for the PCB document.
Example

See also
IPCB_LayerStack interface

FirstAvailableSignalLayer method
(IPCB_LayerStack interface)
Syntax
Function FirstAvailableSignalLayer : IPCB_LayerObject;
Description
This function retrieves the first available signal layer from the layer stack. A layer stack only stores copper based layers such as signal and internal plane layers.
Example

See also
IPCB_LayerStack interface
IPCB_LayerObject interface

InsertLayer method
(IPCB_LayerStack interface)
Syntax
Procedure InsertLayer(L : TLayer);
Description

Example

See also
IPCB_LayerStack interface

LastInternalPlane method
(IPCB_LayerStack interface)
Syntax
Function LastInternalPlane : IPCB_InternalPlane;
Description
This function retrieves the last internal plane from the layer stack if it exists. If there is no internal planes in the layer stack, the function will return a Nil value.
Example

See also
IPCB_LayerStack interface
IPCB_InternalPlane interface

LastLayer property
(IPCB_LayerStack interface)
Syntax
Function LastLayer : IPCB_LayerObject;
Description

Example

See also
IPCB_LayerStack interface


NextLayer property
(IPCB_LayerStack interface)
Syntax
Function NextLayer(L : IPCB_LayerObject) : IPCB_LayerObject;
Description
The Nextlayer property fetches the next layer stored in the layer stack for the PCB document after the FirstLayer property has been invoked. Notice that the layer stack only stores signal and internal (copper based) layers.
Example

Var PCBBoard : IPCB_Board; TheLayerStack : IPCB_LayerStack; i : Integer; LayerObj : IPCB_LayerObject; LS : String; Begin PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; // Note that the Layer stack only stores existing copper based layers. TheLayerStack := PCBBoard.LayerStack; If TheLayerStack = Nil Then Exit; LS := ''; LayerObj := TheLayerStack.FirstLayer; Repeat LS := LS + Layer2String(LayerObj.LayerID) + #13#10; LayerObj := TheLayerStack.NextLayer(LayerObj); Until LayerObj = Nil; ShowInfo('The Layer Stack has :'#13#10 + LS); End;

 

 

See also
IPCB_LayerStack interface

PreviousLayer method
(IPCB_LayerStack interface)
Syntax
Function PreviousLayer(L : IPCB_LayerObject) : IPCB_LayerObject;
Description
The Previous layer property fetches the previous layer stored in the layer stack for the PCB document after the FirstLayer property has been invoked. Notice that the layer stack only stores signal and internal (copper based) layers.
Example

See also
IPCB_LayerStack interface

SignalLayerCount method
(IPCB_LayerStack interface)
Syntax
Function SignalLayerCount : Integer;
Description
This function returns the number of signal layers in the layer stack for the PCB document.
Example

See also
IPCB_LayerStack interface

RemoveFromStack method
(IPCB_LayerStack interface)
Syntax
Procedure RemoveFromStack(L : IPCB_LayerObject);
Description
This procedure removes the targeted layer (represented by the IPCB_LayerObject interface) from the layer stack.
Example

See also
IPCB_LayerStack interface
IPCB_LayerObject interface

InsertInStackBelow method
(IPCB_LayerStack interface)
Syntax
Procedure InsertInStackBelow(RefL : IPCB_LayerObject;
L : IPCB_LayerObject);
Description

Example

See also
IPCB_LayerStack interface
IPCB_LayerObject interface
InsertInStackAbove method
(IPCB_LayerStack interface)
Syntax
Procedure InsertInStackAbove(RefL : IPCB_LayerObject;
L : IPCB_LayerObject);
Description

Example

See also
IPCB_LayerStack interface
IPCB_LayerObject interface

Properties

Board property
(IPCB_LayerStack interface)
Syntax
Property Board : IPCB_Board Read GetState_Board;
Description
This property returns the PCB document that is represented by the IPCB_Board interface, that the layer stack is associated with.
Example

See also
IPCB_LayerStack interface
IPCB_Board interface

DielectricBottom property
(IPCB_Board interface)
Syntax
Property DielectricBottom : IPCB_DielectricObject Read GetState_DielectricBottom;
Description
This property returns the IPCB_DielectricObject interface associated with the dielectric information for the bottom layer of the layer stack.
Example

See also
IPCB_DielectricObject interface

DielectricTop property
(IPCB_Board interface)
Syntax
Property DielectricTop : IPCB_DielectricObject Read GetState_DielectricTop;
Description
This property returns the IPCB_DielectricObject interface associated with the dielectric information for the top layer of the layer stack.
Example

See also
IPCB_DielectricObject interface

LayerObject property
(IPCB_LayerStack interface)
Syntax
Property LayerObject TLayer : IPCB_LayerObject Read GetState_LayerObject;
Description
The LayerObject property retrieves the layer object interface for the specified layer, L of TLayer type. It is a read only property.
Example

Var PCBBoard : IPCB_Board; TheLayerStack : IPCB_LayerStack; i : Integer; LayerObj : IPCB_LayerObject; LS : String; Begin PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; TheLayerStack := PCBBoard.LayerStack; If TheLayerStack = Nil Then Exit; LS := ''; LayerObj := TheLayerStack.FirstLayer; Repeat LS := LS + Layer2String(LayerObj.LayerID) + #13#10; LayerObj := TheLayerStack.NextLayer(LayerObj); Until LayerObj = Nil; ShowInfo('The Layer Stack has :'#13#10 + LS); End;

See also
IPCB_LayerStack interface
IPCB_LayerObject interface
TLayer type

ShowDielectricBottom property
(IPCB_LayerStack interface)
Syntax
Property ShowDielectricBottom : Boolean Read GetState_ShowBotDielectric Write SetState_ShowBotDielectric;
End;
Description
This property enables or disables the dielectric layer for the bottom layer.
Example

See also
IPCB_LayerStack interface

 


ShowDielectricTop property
(IPCB_LayerStack interface)
Syntax
Property ShowDielectricTop : Boolean Read GetState_ShowTopDielectric Write SetState_ShowTopDielectric;
Description
This property enables or disables the dielectric layer for the top layer.
Example

See also
IPCB_LayerStack interface

 

IPCB_SpecialStringConverter Interface


Overview
The IPCB_SpecialStringConverter interface provides a way to fetch special strings in a PCB Project. You would need to pass the document as a parameter in the Convert function and obtain the special strings.

IPCB_SpecialStringConverter
methods
FirstSpecialStringName
NextSpecialStringName
Convert

IPCB_SpecialStringConverter
properties

See also
IPCB_ServerInterface interface
IPCB_Text interface

Methods

Convert method
(IPCB_SpecialStringConverter interface)
Syntax
Function Convert(Const Primitive : IPCB_Primitive;Const aString : TString;Out ConvertedString : TPCBString) : Boolean;
Description
The convert function converts a special string as a formatted string and returns a boolean result whether the conversion is a success or not.
Example

See also
IPCB_SpecialStringConverter interface

FirstSpecialStringName method
(IPCB_SpecialStringConverter interface)
Syntax
Function FirstSpecialStringName : TPCBString;
Description
This function obtains the first special string name used in a design project (for example a PCB Project).
Example

See also
IPCB_SpecialStringConverter interface
NextSpecialStringName method

NextSpecialStringName method
(IPCB_SpecialStringConverter interface)
Syntax
Function NextSpecialStringName : TPCBString;
Description
This function obtains the next special string name used in a design project (for example a PCB Project).
Example

See also
IPCB_SpecialStringConverter interface

 

IPCB_PrimitiveCounter Interface

Overview
The IPCB_PrimitiveCounter interface gives you the means of obtaining the hole count and string count for the focussed PCB document via the IPCB_Board's PrimitiveCounter property.

IPCB_PrimitiveCounter
methods
GetObjectCount
GetCount
GetHoleCount
GetStringCount

IPCB_PrimitiveCounter
properties
HoleCount
StringCount

See also
IPCB_Board interface

Methods

GetCount method
(IPCB_PrimitiveCounter interface)
Syntax
Function GetCount (ObjectSet : TObjectSet) : Cardinal;
Description
The GetCount function counts the objects of a set of object types specified by the ObjectSet parameter.
Example

See also
IPCB_PrimitiveCounter interface
TObjectSet type

GetHoleCount method
(IPCB_PrimitiveCounter interface)
Syntax
Function GetHoleCount : Cardinal;
Description
This function counts the holes (pads and vias) on the current PCB document.
Example

See also
IPCB_PrimitiveCounter interface

GetObjectCount method
(IPCB_PrimitiveCounter interface)
Syntax
Function GetObjectCount (ObjectId: TObjectId) : Cardinal;
Description
This function counts objects of a specific object type.
Example

See also
IPCB_PrimitiveCounter interface

GetStringCount method
(IPCB_PrimitiveCounter interface)
Syntax
Function GetStringCount : Cardinal
Description
This function counts text strings on the PCB document.
Example

See also
IPCB_PrimitiveCounter interface

Properties

HoleCount property
(IPCB_PrimitiveCounter interface)
Syntax
Property HoleCount : Cardinal Read GetHoleCount;
Description
This property obtains the hole count from the PCB document (Pads and Vias).
Example

See also
IPCB_PrimitiveCounter interface

StringCount property
(IPCB_PrimitiveCounter interface)
Syntax
Property StringCount : Cardinal Read GetStringCount;
Description
This property obtains string (text object) count from the PCB document.
Example

See also
IPCB_PrimitiveCounter interface

PCB Layer Interfaces

IPCB_LayerObject interface

Overview
The IPCB_LayerObject interface represents a layer used in a PCB document. Each layer has properties such as layer id, name, used by primitives and whether it is displayed for example. This interface is a property in the IPCB_LayerStack interface.
The layer stack for a PCB document only deals with copper based layers such as signal and internal plane layers. Each layer in the layer stack can have dielectric information and layer pairs can be specified. However there is a LayerObject property in the IPCB_LayerStack interface which allows you to access any PCB layer for the PCB board.

Iterating for any PCB layer of a PCB document
Although the IPCB_LayerStack interface basically deals with copper based layers that are used in the layer stack, this Layer Stack interface can be used to look for other PCB layers that are not in the layer stack. The LayerObject property from this layer stack interface obtains any PCB layer whether it is a keep out layer, top signal layer or a mechanical 16 layer.

 

IPCB_LayerObject
methods

 

IPCB_PrimitiveCounter
properties

Function I_ObjectAddress : TPCBObjectHandle;
Function IsInLayerStack : Boolean;
Property LayerStack : IPCB_LayerStack
Property LayerID : TLayer
Property Name : TPCBString
Property CopperThickness : TCoord
Property Dielectric : IPCB_DielectricObject
Property UsedByPrims : Boolean
Property IsDisplayed[Board : IPCB_Board] : Boolean
Property PreviousLayer : TLayer
Property NextLayer : TLayer

 

 

Example

Var PCBBoard : IPCB_Board; TheLayerStack : IPCB_LayerStack; i : Integer; LayerObj : IPCB_LayerObject; LS : String; Begin PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; // Note that the Layer stack only stores // existing copper based layers. // But you can use the LayerObject property to fetch all layers. TheLayerStack := PCBBoard.LayerStack; If TheLayerStack = Nil Then Exit; LS := ''; LayerObj := TheLayerStack.FirstLayer; Repeat LS := LS + Layer2String(LayerObj.LayerID) + #13#10; LayerObj := TheLayerStack.NextLayer(LayerObj); Until LayerObj = Nil; ShowInfo('The Layer Stack has :'#13#10 + LS); End;

See also
TLayer enumerated values
TCoord value
IPCB_DielectricObject interface
IPCB_LayerStack interface

IPCB_MechanicalLayer interface

Overview
There are 16 general purpose mechanical layers for defining the board layout, placing dimensions on, including fabrication details on, or any other mechanical details the design requires.
To obtain mechanical layers, you iterate for layers on a PCB document, and once you determine it is a mechanical layer, you can wrap the layer as a IPCB_MechanicalLayer interface.
Note that the Layer stack only stores existing copper based layers, but you can use the LayerObject property from the IPCB_LayerStack interface to fetch all layers by using a Layer loop.

Code snippet

TheLayerStack := PCBBoard.LayerStack; If TheLayerStack = Nil Then Exit; For Layer := eMechanical1 to eMechanical16 Do Begin MechLayerObj := TheLayerStack.LayerObject[Layer]; // where MechLayerObj is a IPCB_MechanicalLayer type End;

The IPCB_MechanicalLayer interface hierarchy is as follows;
IPCB_LayerObject
IPCB_MechanicalLayer

IPCB_MechanicalLayer methods
GetState_MechLayerEnabled
GetState_DisplayInSingleLayerMode
GetState_LinkToSheet
SetState_MechLayerEnabled
SetState_DisplayInSingleLayerMode
SetState_LinkToSheet

IPCB_MechanicalLayer properties
MechanicalLayerEnabled
DisplayInSingleLayerMode
LinkToSheet

Example

Var PCBBoard : IPCB_Board; TheLayerStack : IPCB_LayerStack; i : Integer; LayerObj : IPCB_MechanicalLayer; Layer : TLayer; LS : String; Begin PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; // Note that the Layer stack only stores existing copper based layers. // But you can use the LayerObject property to fetch all layers. TheLayerStack := PCBBoard.LayerStack; If TheLayerStack = Nil Then Exit; LS := ''; For Layer := eMechanical1 to eMechanical16 Do Begin LayerObj := TheLayerStack.LayerObjectLayer; ShowMessage(Layer2String(Layer) + #13 + ' linked ' + BooleanToString(LayerObj.LinkToSheet) + #13 + ' enabled ' + BooleanToString(LayerObj.MechanicalLayerEnabled) + #13 + ' displayed in single layer mode ' + BooleanToString(LayerObj.DisplayInSingleLayerMode) + #13); End; End; End;

 

See also

IPCB_LayerObject interface
IPCB_LayerStack interface
TLayer enumerated values

Methods

SetState_MechLayerEnabled method
(IPCB_MechanicalLayer interface)
Syntax
Procedure SetState_MechLayerEnabled (Value : Boolean);
Description
This method determines whether this mechanical layer is enabled or not for the current PCB document. You cannot disable the mechanical layers that already have design objects on them.
This method is used by the MechLayerEnabled property.
Example

See also
IPCB_MechanicalLayer interface

SetState_LinkToSheet method
(IPCB_MechanicalLayer interface)
Syntax
Procedure SetState_LinkToSheet (Value : Boolean);
Description
This method determines whether this mechanical layer is linked to the sheet on the PCB document or not. Once a sheet is linked to the mechanical layer, the sheet is re-sized automatically to fit the objects on the linked layer when a zoom command is executed.
This method is used for the LinkToSheet property.
Example

See also
IPCB_MechanicalLayer interface

SetState_DisplayInSingleLayerMode method
(IPCB_MechanicalLayer interface)
Syntax
Procedure SetState_DisplayInSingleLayerMode(Value : Boolean);
Description
This method determines whether the document is displayed in the single layer mode. Set it true to override the system's single layer mode setting and the design objects on these enabled single layer mode mechanical layers still show up in the single layer mode.
This method is used by the DisplayInSingleLayerMode property.
Example

See also
IPCB_MechanicalLayer interface

GetState_MechLayerEnabled method
(IPCB_MechanicalLayer interface)
Syntax
Function GetState_MechLayerEnabled : Boolean;
Description
This method determines whether this mechanical layer is enabled or not for the current PCB document. You cannot disable the mechanical layers that already have design objects on them.
This method is used by the MechLayerEnabled property.
Example

See also
IPCB_MechanicalLayer interface

GetState_LinkToSheet method
(IPCB_MechanicalLayer interface)
Syntax
Function GetState_LinkToSheet : Boolean;
Description
This method determines whether this mechanical layer is linked to the sheet on the PCB document or not. Once a sheet is linked to the mechanical layer, the sheet is re-sized automatically to fit the objects on the linked layer when a zoom command is executed.
This method is used for the LinkToSheet property.
Example

See also
IPCB_MechanicalLayer interface


GetState_DisplayInSingleLayerMode method
(IPCB_MechanicalLayer interface)
Syntax
Function GetState_DisplayInSingleLayerMode : Boolean;
Description
This method determines whether the document is displayed in the single layer mode. Set it true to override the system's single layer mode setting and the design objects on these enabled single layer mode mechanical layers still show up in the single layer mode.
This method is used by the DisplayInSingleLayerMode property.
Example

See also
IPCB_MechanicalLayer interface

Properties

MechanicalLayerEnabled property
(IPCB_MechanicalLayer interface)
Syntax
Property MechanicalLayerEnabled : Boolean Read GetState_MechLayerEnabled Write SetState_MechLayerEnabled;
Description
This property determines whether this mechanical layer is enabled or not for the current PCB document. You cannot disable the mechanical layers that already have design objects on them.
This property is supported by the GetState_MechLayerEnabled and SetState_MechLayerEnabled methods.
Example

See also
IPCB_MechanicalLayer interface

LinkToSheet property
(IPCB_MechanicalLayer interface)
Syntax
Property LinkToSheet : Boolean Read GetState_LinkToSheet Write SetState_LinkToSheet;
Description
This property determines whether this mechanical layer is linked to the sheet on the PCB document or not. Once a sheet is linked to the mechanical layer, the sheet is re-sized automatically to fit the objects on the linked layer when a zoom command is executed.
This property is supported by the SetState_LinkToSheet and GetState_LinkToSheet methods.
Example

See also
IPCB_MechanicalLayer interface

DisplayInSingleLayerMode property
(IPCB_MechanicalLayer interface)
Syntax
Property DisplayInSingleLayerMode : Boolean Read GetState_DisplayInSingleLayerMode Write SetState_DisplayInSingleLayerMode;
Description
This property determines whether the document is displayed in the single layer mode. Set it true to override the system's single layer mode setting and the design objects on these enabled single layer mode mechanical layers still show up in the single layer mode.
This property is supported by the GetState_DisplayInSingleLayerMode and SetState_DisplayInSingleLayerMode methods.
Example

See also
IPCB_MechanicalLayer interface

IPCB_DielectricObject interface

Overview
The IPCB_DielectricObject interface represents the dielectric properties for the specified PCB layer.

Notes
The IPCB_DielectricObject interface is used by the IPCB_LayerStack interface.

Methods Properties
Function I_ObjectAddress : TPCBObjectHandle; DielectricMaterial : TPCBString 
DielectricType : TDielectricType
DielectricConstant : TReal 
DielectricHeight : TCoord

 

 

Example

Function ConvertDielectricTypeTOString (DT : TDielectricType): String; Begin Result := 'Unknown Type'; Case DT Of eNoDielectric : Result := 'No Dielectric'; eCore : Result := 'Core'; ePrePreg : Result := 'PrePreg'; eSurfaceMaterial : Result := 'Surface Material'; End; End; {..........................................................................} {..........................................................................} Function GetLayerInfo(Board : IPCB_Board; Var LayerID : TLayer) : String; Var LayerObj : IPCB_LayerObject; Begin LayerObj := Board.LayerStack.LayerObject[LayerId]; Result := Layer2String(LayerID) + ', ' + LayerObj.Name + ', ' + 'Copper' + ', ' + FloatToStr(LayerObj.CopperThickness / 10000) + ', '; If LayerObj.Dielectric.DielectricType <> eNoDielectric Then Begin Result := Result + ConvertDielectricTypeTOString(LayerObj.Dielectric.DielectricType) + ', ' + LayerObj.Dielectric.DielectricMaterial + ', ' + FloatToStr(LayerObj.Dielectric.DielectricHeight / 10000) + ', ' + FloatToStr(LayerObj.Dielectric.DielectricConstant); End; LayerObj := Board.LayerStack.NextLayer(LayerObj); If LayerObj <> Nil Then LayerID := LayerObj.LayerID Else LayerID := eNoLayer; End; {..........................................................................} {..........................................................................} Procedure FetchLayersInformation; Var Board : IPCB_Board; Str : String; Layer : TLayer; Begin Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; Str := 'Layer, Name, Material, Cu Thickness, Dielectric Material, type, constant, height ' + #13#10; Layer := MinLayer; Repeat Str := Str + GetLayerInfo(Board, Layer) + #13#10; Until Layer = eNoLayer; // Do what you want with the Str string. End;

See also
IPCB_LayerStack interface
LayerReport script in the \ Example s\Scripts\DelphiScript\PCB\ folder.

IPCB_DrillLayerPair interface

Overview
The IPCB_DrillLayerPair interface represents the paired drill layer for the layer stack up for the PCB document.
Notes
The IPCB_DrillLayerPair interface is a standalone interface
The IPCB_DrillLayerPair interface is a DrillLayerPair property from the IPCB_Board interface

Methods Properties

Function I_ObjectAddress : TPCBObjectHandle;
Function GetState_Description : TPCBString;
Function IsSimilarTo(ADLP : IPCB_DrillLayerPair) : Boolean;
Procedure OrderLayers;

LowLayer : TLayer
HighLayer : TLayer
StartLayer : IPCB_LayerObject
StopLayer : IPCB_LayerObject
Board : IPCB_Board 
PlotDrillDrawing : Boolean 
PlotDrillGuide : Boolean

 

Example

Var PCBBoard : IPCB_Board; i : Integer; LayerPairs : TStringList; PCBLayerPair : IPCB_DrillLayerPair; LowLayerObj : IPCB_LayerObject; HighLayerObj : IPCB_LayerObject; LowPos : Integer; HighPos : Integer; LS : String; Begin PCBBoard := PCBServer.GetCurrentPCBBoard; If PCBBoard = Nil Then Exit; // Show the current layer ShowInfo('Current Layer: ' + Layer2String(PCBBoard.CurrentLayer)); LayerPairs := TStringList.Create; For i := 0 To PCBBoard.DrillLayerPairsCount - 1 Do Begin PCBLayerPair := PCBBoard.LayerPair[i]; LowLayerObj := PCBBoard.LayerStack.LayerObject[PCBLayerPair.LowLayer]; HighLayerObj := PCBBoard.LayerStack.LayerObject[PCBLayerPair.HighLayer]; LowPos := PCBBoard.LayerPositionInSet(SignalLayers + InternalPlanes, LowLayerObj); HighPos := PCBBoard.LayerPositionInSet(SignalLayers + InternalPlanes, HighLayerObj); If LowPos <= HighPos Then LayerPairs.Add(LowLayerObj .Name + ' - ' + HighLayerObj.Name) Else LayerPairs.Add(HighLayerObj.Name + ' - ' + LowLayerObj .Name); End; //Display layer pairs. LS := ''; For i := 0 to LayerPairs.Count - 1 Do LS := LS + LayerPairs[i] + #13#10; ShowInfo('Layer Pairs:'#13#10 + LS); LayerPairs.Free; End;

See also
TLayer enumerated values
TCoord value
IPCB_LayerObject interface
IPCB_Board interface

IPCB_InternalPlane interface

Overview
This IPCB_InternalPlane interface represents an existing internal plane used on a PCB document. 16 internal planes are supported, and a net can be assigned to each of these layers or share a power plane between a number of nets by splitting the it into two or more isolated areas.
Pad and via connections to power planes are controlled by the Plane design rules.
The IPCB_InternalPlane interface is used by the IPCB_LayerStack interface.

Methods Properties
  PullBackDistance : TCoord 
NetName : TPCBString
FirstPreviousSignalLayer : TLayer //Read only
FirstNextSignalLayer : TLayer //Read only

 

See also
TLayer enumerated values
TCoord value
IPCB_LayerStack interface

IPCB_MechanicalLayerPairs interface

Overview
There are 16 general purpose mechanical layers for defining the board layout, placing dimensions on, including fabrication details on, or any other mechanical details the design requires.
The purpose of the IPCB_MechanicalLayerPairs Interface is to provide which Mechanical layers are paired to one another.
When a component incorporates objects on one or more Mechanical layers which have been paired, the Layer property of those objects changes when the Layer property of the component is toggled (between the Top and Bottom layers), just like objects on the non-Mechanical layers which have always been paired to one another, to wit the Top and Bottom (copper) layers, the Top and Bottom Overlay layers, the Top and Bottom Paste Mask layers, and the Top and Bottom Solder Mask layers.
Notes
The IPCB_MechanicalLayerPairs interface is a MechanicalPairs property of the IPCB_Board interface.
Invoke the Count method to obtain the number of mechanical layer pairs for the existing PCB document. Indexed mechanical layer pairs which is a LayerPair[] property can be returned. This property returns a TMechanicalLayerPair record of two PCB layers.

 

Methods Properties

Procedure Clear;
Function Count : Integer;
Function AddPair (Layer1,
Layer2 : TLayer) : Integer;
Function RemovePair (Layer1,
Layer2 : TLayer) : Boolean;
Function PairDefined(Layer1,
Layer2 : TLayer) : Boolean;
Function LayerUsed (Layer : TLayer) : Boolean;
Function FlipLayer(Var L : TLayer) : Boolean;

Procedure Import_FromParameters(Params : PChar);
Procedure Export_ToParameters (Params : PChar);

LayerPair [I : Integer] : TMechanicalLayerPair

 

 

Example

Var Board : IPCB_Board; Layer : TLayer; LS : IPCB_LayerStack; LObject : IPCB_LayerObject; S : TPCBString; Begin Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; LS := Board.LayerStack; If LS = Nil Then Exit; S := ''; For Layer := eMechanical1 to eMechanical16 Do Begin LObject := LS.LayerObject[Layer]; // If a mechanical layer is not enabled (as per the Board Layers and // Colors dialog) then this layer cannot be displayed nor have any objects on it. If Not (LObject.MechanicalLayerEnabled) Then S := S + LObject.Name + ' is NOT enabled (thus it cannot be displayed nor have any objects on it).' + #13 Else Begin If (LObject.IsDisplayed[Board] = True) and (LObject.UsedByPrims) Then S := S + LObject.Name + ' is displayed and there are objects on it.' + #13; If (LObject.IsDisplayed[Board] = True) and Not (LObject.UsedByPrims) Then S := S+ LObject.Name + ' is displayed and there are NO objects on it.' + #13; If (LObject.IsDisplayed[Board] = False) and (LObject.UsedByPrims) Then S := S + LObject.Name + ' is NOT displayed and there are objects on it.' + #13; If (LObject.IsDisplayed[Board] = False) and Not (LObject.UsedByPrims) Then S := S + LObject.Name + ' is NOT displayed and there are NO objects on it.' + #13; End; End; ShowMessage(S); End;

See also
TLayer enumerated values
TMechanicalLayerPair values
IPCB_LayerStack interface

PCB Options Interfaces

IPCB_AbstractOptions interface

Overview
The IPCB_AbstractOptions interface is the base interface for other options related interfaces such as SystemOptions and InteractiveRoutingOptions through IPCB_ServerInterface. These option objects are global objects created by the PCB Server.
The other OutputOptions, ECOOptions, GerberOptions, PrinterOptions and PlacerOptions interfaces are referenced through IPCB_Board interface.
Notes
Ancestor interface for ECO Options, Output Options, Gerber Options, Printer Options, Advanced Placer Options, SystemOptions, Design Rule Checker Options, SpecctraRouter Options and Interactive Routing options interfaces.

Methods Properties
Procedure Import_FromParameters (DisplayUnit : TUnit;
Parameters : PChar);
Procedure Export_ToParameters (Parameters : PChar);
Procedure Import_FromParameters_Version4 (DisplayUnit : TUnit;
Parameters : PChar);
Procedure Export_ToParameters_Version4 (Parameters : PChar);
Procedure Import_FromParameters_Version3 (DisplayUnit : TUnit;
Parameters : PChar);
Procedure Export_ToParameters_Version3 (Parameters : PChar);
Function I_ObjectAddress : TPCBObjectHandle;
OptionsObjectID : TOptionsObjectId

See also

IPCB_ECOOptions interface
IPCB_OutputOptions interface
IPCB_GerberOptions interface
IPCB_PrinterOptions interface
IPCB_AdvancedPlacerOptions interface
IPCB_SystemOptions interface
IPCB_DesignRuleCheckerOptions interface
IPCB_SpecctraRouterOptions interface
IPCB_InteractiveRoutingOptions interface

IPCB_AdvancedPlacerOptions interface

Overview
The IPCB_AdvancedPlacerOptions interface represents the options for the placement application.

Notes
Derived from IPCB_AbstractOptions interface
IPCB_ Properties
Property PlaceLargeClear : TCoord
Property PlaceSmallClear : TCoord
Property PlaceUseRotation : Boolean
Property PlaceUseLayerSwap : Boolean
Property PlaceByPassNet1 : TPCBString
Property PlaceByPassNet2 : TPCBString
Property PlaceUseAdvancedPlace : Boolean
Property PlaceUseGrouping : Boolean
See also
IPCB_AbstractOptions interface

IPCB_DesignRuleCheckerOptions interface

Overview
The IPCB_DesignRuleCheckerOptions interface deals with the DRC options.

Notes
Derived from IPCB_AbstractOptions interface

Methods
Procedure Export_ToParameters_GeneralOptions (Parameters : PChar);
Procedure Export_ToParameters_RulesToCheck (Parameters : PChar);
Procedure Export_ToParameters_RulesToCheck_Version3 (Parameters : PChar);
Procedure Import_FromParameters_GeneralOptions (Parameters : PChar);
Procedure Import_FromParameters_RulesToCheck (Parameters : PChar);

Properties
Property OnLineRuleSetToCheck : TRuleSet
Property DoMakeDRCFile : Boolean
Property DoMakeDRCErrorList : Boolean
Property DoSubNetDetails : Boolean
Property RuleSetToCheck : TRuleSet
Property ReportFilename : TPCBString
Property ExternalNetListFileName : TPCBString
Property CheckExternalNetList : Boolean
Property MaxViolationCount : Integer
Property InternalPlaneWarnings : Boolean
Property VerifyShortingCopper : Boolean

See also
IPCB_AbstractOptions interface

IPCB_ECOOptions interface

Overview
The IPCB_ECOOptions represents an existing Engineering Change Order options object in a PCB document.
Notes
Derived from IPCB_AbstractOptions interface
Properties
Property ECOIsActive : Boolean
Property ECOFileName : TString
See also
IPCB_AbstractOptions interface

IPCB_GerberOptions interface

Overview
The tolerance range used when matching apertures for each item in the plots. If no exact match for an item is available in the current aperture list, the software checks to see if a larger aperture exists within this tolerance range and uses it instead.
If no suitable aperture exists within the tolerance range, the software will attempt to "paint" with a larger aperture to create the required shape. This requires that a suitable larger aperture is available, and that this aperture can be used for "painting".
Note: Match tolerances are normally only used when you are targeting a vector photoplotter, which require a fixed, or supplied aperture file. They will not be required if the apertures have been created from the PCB. If match tolerances are not required they should be left at the default of 0.005 mil.

Notes
Derived from IPCB_AbstractOptions interface

Properties
Property SortOutput : Boolean
Property UseSoftwareArcs : Boolean
Property CenterPhotoPlots : Boolean
Property EmbedApertures : Boolean
Property Panelize : Boolean
Property G54 : Boolean
Property PlusTol : TCoord
Property MinusTol : TCoord
Property FilmSizeX : TCoord
Property FilmSizeY : TCoord
Property BorderSize : TCoord
Property AptTable : TPCBString
Property MaxAperSize : TCoord
Property ReliefShapesAllowed : Boolean
Property PadsFlashOnly : Boolean
Property GerberUnits : Integer
Property GerberDecs : Integer
See also
IPCB_AbstractOptions interface

IPCB_InteractiveRoutingOptions interface

Overview
The IPCB_InteractiveRoutingOptions interface represents the options for the interactive routing module in the PCB editor.

Notes
Derived from IPCB_AbstractOptions interface

Methods
Procedure Export_ToParameters_GeneralOptions(Parameters : PChar);
Procedure Export_ToParameters_LayerOptions (Parameters : PChar);
Procedure Export_ToParameters_LayerOptions_Version3(Parameters : PChar);

Properties
PlaceTrackMode : TPlaceTrackMode
OldTrackDrawLayer : TLayer
TrackArcX : TCoord
TrackArcY : TCoord
TrackArcRadius : TCoord
TrackArcAngle1 : TCoord
TrackArcAngle2 : TCoord
OldTrackArcX : TCoord
OldTrackArcY : TCoord
OldTrackArcRadius : TCoord
OldTrackArcAngle1 : TCoord
OldTrackArcAngle2 : TCoord
OldTrackDrawSize : TCoord
OldMidx : TCoord
OldMidy : TCoord
OldCx : TCoord
OldCy : TCoord
EndLineX : TCoord
EndLineY : TCoord
Midx : TCoord
MidY : TCoord
StartX : TCoord
StartY : TCoord
Beginx : TCoord
Beginy : TCoord
See also
IPCB_AbstractOptions interface

IPCB_MechanicalLayerPairs interface

Overview
There are 16 general purpose mechanical layers for defining the board layout, placing dimensions on, including fabrication details on, or any other mechanical details the design requires.
The purpose of the IPCB_MechanicalLayerPairs Interface is to provide which Mechanical layers are paired to one another.
When a component incorporates objects on one or more Mechanical layers which have been paired, the Layer property of those objects changes when the Layer property of the component is toggled (between the Top and Bottom layers), just like objects on the non-Mechanical layers which have always been paired to one another, to wit the Top and Bottom (copper) layers, the Top and Bottom Overlay layers, the Top and Bottom Paste Mask layers, and the Top and Bottom Solder Mask layers.

Notes
The IPCB_MechanicalLayerPairs interface is a MechanicalPairs property of the IPCB_Board interface.
Invoke the Count method to obtain the number of mechanical layer pairs for the existing PCB document. Indexed mechanical layer pairs which is a LayerPair[] property can be returned. This property returns a TMechanicalLayerPair record of two PCB layers.
Methods
Procedure Clear;
Function Count : Integer;
Function AddPair (Layer1,
Layer2 : TLayer) : Integer;
Function RemovePair (Layer1,
Layer2 : TLayer) : Boolean;
Function PairDefined(Layer1,
Layer2 : TLayer) : Boolean;
Function LayerUsed (Layer : TLayer) : Boolean;
Function FlipLayer(Var L : TLayer) : Boolean;

Procedure Import_FromParameters(Params : PChar);
Procedure Export_ToParameters (Params : PChar);

Properties
LayerPair [I : Integer] : TMechanicalLayerPair

Example

Var Board : IPCB_Board; Layer : TLayer; LS : IPCB_LayerStack; LObject : IPCB_LayerObject; S : TPCBString; Begin Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; LS := Board.LayerStack; If LS = Nil Then Exit; S := ''; For Layer := eMechanical1 to eMechanical16 Do Begin LObject := LS.LayerObject[Layer]; // If a mechanical layer is not enabled (as per the Board Layers and // Colors dialog) then this layer cannot be displayed nor have any objects on it. If Not (LObject.MechanicalLayerEnabled) Then S := S + LObject.Name + ' is NOT enabled (thus it cannot be displayed nor have any objects on it).' + #13 Else Begin If (LObject.IsDisplayed[Board] = True) and (LObject.UsedByPrims) Then S := S + LObject.Name + ' is displayed and there are objects on it.' + #13; If (LObject.IsDisplayed[Board] = True) and Not (LObject.UsedByPrims) Then S := S+ LObject.Name + ' is displayed and there are NO objects on it.' + #13; If (LObject.IsDisplayed[Board] = False) and (LObject.UsedByPrims) Then S := S + LObject.Name + ' is NOT displayed and there are objects on it.' + #13; If (LObject.IsDisplayed[Board] = False) and Not (LObject.UsedByPrims) Then S := S + LObject.Name + ' is NOT displayed and there are NO objects on it.' + #13; End; End; ShowMessage(S); End;

See also
TLayer enumerated values
TMechanicalLayerPair values
IPCB_LayerStack interface

IPCB_OutputOptions interface

Overview
The IPCB_OutputOptions interface represents the options for the generation of PCB output such as including mechanical layers in plots etc.
Notes
Derived from IPCB_AbstractOptions interface

Methods
Procedure Import_FromParameters_GeneralOptions (DisplayUnit : TUnit;
Parameters : PChar);
Procedure Import_FromParameters_LayerOptions (Parameters : PChar);
Procedure Import_FromParameters_LayerOptions_Version3 (Parameters : PChar);
Procedure Export_ToParameters_GeneralOptions (Parameters : PChar);
Procedure Export_ToParameters_LayerOptions (Parameters : PChar);
Procedure Export_ToParameters_LayerOptions_Version3 (Parameters : PChar);

Properties
Property DrillGuideHoleSize : TCoord
Property DrillDrawSymbolSize : TCoord
Property DrillSymbolKind : TDrillS
Property MultiLayerOnPadMaster : Boolean
Property TopLayerOnPadMaster : Boolean
Property BottomLayerOnPadMaster : Boolean
Property IncludeViasInSolderMask : Boolean

Property IncludeUnconnectedPads : Boolean
Property PlotLayer [PL : TPlotLayer] : Boolean
Property FlipLayer [PL : TPlotLayer] : Boolean

See also
IPCB_AbstractOptions interface

IPCB_PrinterOptions interface

Overview
The IPCB_PrinterOptions interface represents the Printer options setup in the PCB Editor server.

Notes
Derived from IPCB_AbstractOptions interface

Methods
Procedure Import_FromParameters_GeneralOptions (DisplayUnit : TUnit; Parameters : PChar);
Procedure Import_FromParameters_LayerOptions (Parameters : PChar);
Procedure Import_FromParameters_LayerOptions_Version3 (Parameters : PChar);
Procedure Export_ToParameters_GeneralOptions (Parameters : PChar);
Procedure Export_ToParameters_LayerOptions (Parameters : PChar);
Procedure Export_ToParameters_LayerOptions_Version3 (Parameters : PChar);

Properties
Property Device : TPCBString
Property Driver : TPCBString
Property OutPut : TPCBString
Property OutputDriverType : TOutputDriverType
Property ShowHoles : Boolean
Property ScaleToFitPage : Boolean
Property UsePrinterFonts : Boolean
Property UseSoftwareArcs : Boolean
Property BatchType : TPrinterBatch
Property CompositeType : TPrinterComposite
Property cBorderSize : TCoord
Property Scale : TGeometry
Property XCorrect : TGeometry
Property YCorrect : TGeometry
Property PlotMode [OId : TObjectId] : TDrawMode
Property PlotPadNets : Boolean
Property PlotPadNumbers : Boolean
Property PlotterScale : TGeometry
Property PlotterXCorrect : TGeometry
Property PlotterYCorrect : TGeometry
Property PlotterXOffset : TCoord
Property PlotterYOffset : TCoord
Property PlotterShowHoles : Boolean
Property PlotterUseSoftwareArcs : Boolean
Property PlotterWaitBetweenSheets : Boolean
Property PlotterOutputPort : TOutputPort
Property PlotterLanguage : TPlotterLanguage
Property PlotterPens [PId : Integer] : TPlotterPen
Property CompositePlotMonoLayers [L : TLayer] : TColor
Property CompositePlotColorLayers [L : TLayer] : TColor
Property CompositePlotLayers [L : TLayer] : Boolean
Property CompositePlotPens [L : TLayer] : Integer

See also
IPCB_AbstractOptions interface

IPCB_SpecctraRouterOptions interface

Overview
The IPCB_SpecctraRouterOptions interface represents the options for the Specctra Router application.

Notes
Derived from IPCB_AbstractOptions interface

Properties
Property Setback [I : Integer] : TCoord
Property DoSetback [I : Integer] : Boolean
Property DoBus : Boolean
Property BusDiagonal : Boolean
Property DoQuit : Boolean
Property WireGrid : TReal
Property ViaGrid : TReal
Property DoSeedVias : Boolean
Property NoConflicts : Boolean
Property AdvancedDo : Boolean
Property ReorderNets : Boolean
Property ProtectPreRoutes : Boolean
Property SeedViaLimit : TCoord
Property RoutePasses : Integer
Property CleanPasses : Integer
Property FilterPasses : Integer
Property LayerCost [L : TLayer] : TCCTCost
Property LayerWWCost [L : TLayer] : TCCTCost
Property WwCost : TCCTCost
Property CrossCost : TCCTCost
Property ViaCost : TCCTCost
Property OffGridCost : TCCTCost
Property OffCenterCost : TCCTCost
Property SideExitCost : TCCTCost
Property SqueezeCost : TCCTCost
Property LayerTax [L : TLayer] : TCCTTax
Property LayerWWTax [L : TLayer] : TCCTTax
Property WwTax : TCCTTax
Property CrossTax : TCCTTax
Property ViaTax : TCCTTax
Property OffGridTax : TCCTTax
Property OffCenterTax : TCCTTax
Property SideExitTax : TCCTTax
Property SqueezeTax : TCCTTax
Property DoCritic : Boolean
Property DoMiter : Boolean
Property DoRecorner : Boolean
Property DoFanout : Boolean
Property FoPower : Boolean
Property FoSignal : Boolean
Property FoIn : Boolean
Property FoOut : Boolean
Property FoVias : Boolean
Property FoPads : Boolean
Property FoPasses : Integer
Property ForceVias : Boolean
Property DoSpread : Boolean
Property SortKind : TCCTSort
Property SortDir : TCCTSortDir
Property Adv10 : Boolean
Property Dfm10 : Boolean
Property Hyb10 : Boolean
Property SpVersion : Integer
Property MinimizePads : Boolean

See also
IPCB_AbstractOptions interface

IPCB_SystemOptions interface

Overview
The IPCB_SystemOptions interface represents the global system options in the PCB Editor server.

Notes
Derived from IPCB_AbstractOptions interface

Methods
Procedure Import_FromIniFile;
Procedure Export_ToIniFile;
Procedure AddComponentMapping (Value : TComponentTypeMapping);

Properties
{DisplayOptions}
Property UndoRedoStackSize : Integer
Property SingleLayerMode : Boolean
Property LockPreRoutes : Boolean
Property DrawMode [OId : TObjectID] : TDrawMode
Property FromTosDisplayMode : TFromToDisplayMode
Property PadTypesDisplayMode : TFromToDisplayMode
Property DraftTrackThreshold : TCoord
Property CleanRedraw : Boolean
Property ShowInvisibleObjects : Boolean
Property DisplaySpecialStrings : Boolean
Property RedrawLayerOnToggle : Boolean
Property UseCurrentForMultiLayer : Boolean
Property UseNetColorForHighlight : Boolean
Property HighlightFull : Boolean
Property ShowAllPrimitivesInHighlightedNets : Boolean
Property UseTransparent : Boolean
Property UseDithered : Boolean
Property ShowPadNets : Boolean
Property ShowPadNumbers : Boolean
Property ShowTestPoints : Boolean
Property ShowViaNets : Boolean
Property ShowStatusInfo : Boolean
Property ShowStatusInterval : Integer
Property BoardCursorType : TGraphicsCursor
Property TextToRectSize : Integer
Property AutoPan : Boolean
Property LayerDrawingOrder [I : Integer] : TLayer

{Paste Options}
Property Paste_InSameClass : Boolean
Property Paste_OnSameLayer : Boolean
Property Paste_InSameNet : Boolean
Property Paste_HasSameDesignator : Boolean

{PlaceArray Options}
Property RepeatRotateItem : Boolean
Property RepeatCircular : Boolean
Property RepeatDegrees : TGeometry
Property RepeatX : TGeometry
Property RepeatY : TGeometry
Property RepeatXUnit : TUnit
Property RepeatYUnit : TUnit
Property RepeatCountDefault : Integer
Property RepeatInc : TPCBString

{Com Port Options}
Property Com1Parameters : TSerialParameters
Property Com2Parameters : TSerialParameters
Property Com3Parameters : TSerialParameters
Property Com4Parameters : TSerialParameters

{Netlist load options}
Property CheckPatterns : Boolean
Property CheckComments : Boolean
Property NetlistReportFile : Boolean
Property NetlistReportDialog : Boolean
Property DeleteUnconnectedComps : Boolean
Property DeleteUnconnectedPrims : Boolean

{Misc System Options}
Property GlobalEditIncludeArcsWithTracks : Boolean
Property ValidateOnLoad : Boolean
Property SaveDefs : Boolean
Property DoOnlineDRC : Boolean
Property LoopRemoval : Boolean
Property UseSmartTrackEnds : Boolean
Property DeleteDeadEnds : Boolean
Property QuestionDelete : Boolean
Property QuestionGlobalChange : Boolean
Property QuestionDrag : Boolean
Property NearestComponent : Boolean
Property RemoveDuplicatesOnOutput : Boolean
Property DuplicateDesignatorsAllowed : Boolean
Property AutoVia : Boolean
Property SnapToCentre : Boolean
Property ReportsCSV : Boolean
Property ClickClearsSelection : Boolean
Property HoldShiftToSelectObjectId [OId : TObjectID] : Boolean
Property MustHoldShiftToSelect : Boolean
Property DoubleClickRunsInspector : Boolean
Property DefaultPrimsPermanent : Boolean
Property DragMode : TPcbDragMode
Property RotationStep : TAngle
Property OnlySelectVisible : Boolean
Property PlaceShoveDepth : Integer
Property LayerColors[L : TLayer] : TColor
Property AutoPanMode : TAutoPanMode
Property AutoPanSmallStep : Integer
Property AutoPanLargeStep : Integer
Property AutoPanUnit : TAutoPanUnit
Property AutoPanSpeed : Integer
Property InteractiveRouteMode : TInteractiveRouteMode
Property PolygonThreshold : Integer
Property PolygonRepour : TPolygonRepourMode
Property PlowThroughPolygons : Boolean
Property ProtectLockedPrimitives : Boolean
Property ConfirmSelectionMemoryClear : Boolean
Property ComponentMoveKind : TComponentMoveKind

Property SameNamePadstackReplacementMode : TSameNamePadstackReplacementMode
Property PadstackUpdateFromGlobalsOnLoad : TSameNamePadstackReplacementMode
Property PlaneDrawMode : TPlaneDrawMode
Property BoardAreaColor : TColor
Property BoardLineColor : TColor
Property SheetAreaColor : TColor
Property SheetLineColor : TColor
Property WorkspaceColor1 : TColor
Property WorkspaceColor2 : TColor

DefaultTTFont
PadViaFontName
PadViaFontColor
PadViaFontStyle
PadViaMinFontSize
PadViaFontBkColor
MinPadViaObjectSizeInPixels

Example

Var PCBSystemOptions : IPCB_SystemOptions; Begin PCBSystemOptions := PCBServer.SystemOptions; If PCBSystemOptions = Nil Then Exit; If PcbSystemOptions.BoardCursorType = eCurShapeCross90 Then PcbSystemOptions.BoardCursorType := eCurShapeBigCross Else If PcbSystemOptions.BoardCursorType = eCurShapeBigCross Then PcbSystemOptions.BoardCursorType := eCurShapeCross45 Else PcbSystemOptions.BoardCursorType := eCurShapeCross90; End.

See also
IPCB_AbstractOptions interface
TPCBDragMode enumerated values
TGraphicsCursor enumerated values
TComponentTypeMapping enumerated values
TComponentMoveKind enumerated values
TPolygonRepourMode enumerated values
TSameNamePadstackReplacementMode enumerated values
TPlaneDrawMode enumerated values
TAutoPanUnit enumerated values
TAutoPanMode enumerated values
TInteractiveRouteMode enumerated values

Found an issue with this document? Highlight the area, then use Ctrl+Enter to report it.

Contact Us

Contact our corporate or local offices directly.

We're sorry to hear the article wasn't helpful to you.
Could you take a moment to tell us why?
200 characters remaining
You are reporting an issue with the following selected text
and/or image within the active document: