Created: June 06, 2016 | Updated: September 26, 2016
| Applies to versions: 3.1, 3.2, 4 and 5
Nexus message
This documentation page references Altium NEXUS/NEXUS Client (part of the deployed NEXUS solution), which has been discontinued. All your PCB design, data management and collaboration needs can now be delivered by Altium Designer and a connected Altium 365 Workspace. Check out the FAQs page for more information.
Please note that this documentation was last updated for an older version of Altium NEXUS. While many of the principles and approaches will remain the same, be aware that interfaces, objects, methods, properties, and the like will have changed since then, and will not reflect the entirety of those found in later versions of the software.
PCB API: System Interfaces Reference
Copy LinkCopied
The PCB API System Interfaces reference includes the following sections and content:
Overview
When you need to work with PCB design objects in Altium NEXUS, 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 IPCB_ServerInterface interface.
Note that these IServerModule interfaces represent loaded servers in Altium NEXUS. The Altium NEXUS 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 NEXUS 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 NEXUS, 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 andPostProcess 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.
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
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
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
showMessage('This is not a PCB library document.');
10
Exit;
11
End;
12
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
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
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
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 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 NEXUS.
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.
(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
//Notify PCB that the fill object is going to be changed.
04
PCBServer.SendMessageToRobots(
05
Fill.I_ObjectAddress,
06
c_Broadcast,
07
PCBM_BeginModify ,
08
c_NoEventData);
09
10
Fill.Layer := eBottomLayer;
11
12
//Notify PCB that the fill object has been changed.
13
PCBServer.SendMessageToRobots(
14
Fill.I_ObjectAddress,
15
c_Broadcast,
16
PCBM_EndModify ,
17
c_NoEventData);
18
19
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
//Notify PCB that the fill object is going to be changed.
05
PCBServer.SendMessageToRobots(
06
Fill.I_ObjectAddress,
07
c_Broadcast,
08
PCBM_BeginModify ,
09
c_NoEventData);
10
11
Fill.Layer := eBottomLayer;
12
13
//Notify PCB that the fill object has been changed.
14
PCBServer.SendMessageToRobots(
15
Fill.I_ObjectAddress,
16
c_Broadcast,
17
PCBM_EndModify ,
18
c_NoEventData);
19
Finally
20
PCBServer.PostProcess;
21
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
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
Overview
The IPCB_Board interface encapsulates an opened PCB document in Altium NEXUS 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
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.
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
(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
(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
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 NEXUS 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
(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
IfNot(Board.ChooseRectangleByCorners( 'Choose first corner',
5
'Choose final corner',
6
x1,y1,x2,y2)) ThenExit;
7
8
// The coordinates from the ChooseRectangleByCorners method
9
// 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.
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 NEXUS 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
// Format the layer pairs data string and display it.
22
LS := '';
23
Fori := 0toLayerPairs.Count - 1Do
24
LS := LS + LayerPairs[i] + #13#10;
25
ShowInfo('Layer Pairs:'#13#10+ LS);
26
LayerPairs.Free;
27
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.
(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
(* Top/Bottom Layers and Arc/Track objects defined
04
for the Spatial iterator constraints *)
05
ASetOfLayers := MkSet(eTopLayer,eBottomLayer);
06
ASetOfObjects := MkSet(eArcObject,eTrackObject);
07
08
Iterator.AddFilter_ObjectSet(ASetOfObjects);
09
Iterator.AddFilter_LayerSet(ASetOfLayers);
10
Iterator.AddFilter_Area(X1,Y1,X2,Y2);
11
12
(* Iterate for tracks and arcs on bottom/top layers *)
13
PCBObject := Iterator.FirstPCBObject;
14
WhilePCBObject <> 0Do
15
Begin
16
PCBObject.Selected := True;
17
PCBObject := Iterator.NextPCBObject;
18
End;
19
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
(* Top/Bottom Layers and Arc/Track objects defined
04
for the Spatial iterator constraints *)
05
ASetOfLayers := MkSet(eTopLayer,eBottomLayer);
06
ASetOfObjects := MkSet(eArcObject,eTrackObject);
07
08
Iterator.AddFilter_ObjectSet(ASetOfObjects);
09
Iterator.AddFilter_LayerSet(ASetOfLayers);
10
Iterator.AddFilter_Area(X1,Y1,X2,Y2);
11
12
(* Iterate for tracks and arcs on bottom/top layers *)
13
PCBObject := Iterator.FirstPCBObject;
14
WhilePCBObject <> 0Do
15
Begin
16
PCBObject.Selected := True;
17
PCBObject := Iterator.NextPCBObject;
18
End;
19
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
(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
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
(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 NEXUS. 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
'Board Units = '+ UnitToString(Board.DisplayUnit));
8
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
// do what you want with the LowLayerObj and HighLayerObj objects
23
End;
24
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
'Board Units = '+ UnitToString(Board.DisplayUnit));
8
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
(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 [L : 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 [L : 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 [L : 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
// Check for each signal layer for used/display setting
5
ForLayer := eTopLayer toeMultiLayer Do
6
IfPCBBoard.LayerIsUsed[Layer] Then
7
IfPCBBoard.LayerIsDisplayed[Layer] Then
8
\\ dosomething
See also
IPCB_Board interface
LayerIsUsed property
(IPCB_Board interface) Syntax Property LayerIsUsed [L : 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
// Check for each signal layer for used/display setting
5
ForLayer := eTopLayer toeMultiLayer Do
6
IfPCBBoard.LayerIsUsed[Layer] Then
7
IfPCBBoard.LayerIsDisplayed[Layer] Then
8
\\ dosomething
9
See also
IPCB_Board interface
LayerPair property
(IPCB_Board interface) Syntax Property LayerPair [I : 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
(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
// Note that the Layer stack only stores existing copper based layers.
12
// But you can use the LayerObject property to fetch all layers.
13
TheLayerStack := PCBBoard.LayerStack;
14
IfTheLayerStack = NilThenExit;
15
LS := '';
16
LayerObj := TheLayerStack.FirstLayer;
17
Repeat
18
LS := LS + Layer2String(LayerObj.LayerID) + #13#10;
19
LayerObj := TheLayerStack.NextLayer(LayerObj);
20
UntilLayerObj = Nil;
21
ShowInfo('The Layer Stack has :'#13#10+ LS);
22
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 NEXUS. 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
(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.
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
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
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
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 NEXUS.
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
See also
IPCB_Library interface
IPCB_LibComponent interface
IPCB_Sheet
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_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
(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
The Altium NEXUS API supports three layer stack interfaces:
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.
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 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 Options Interfaces
Copy LinkCopied
IPCB_AbstractOptions
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.
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
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