Contact our corporate or local offices directly.
Parent page: Altium NEXUS API
The Altium NEXUS Application Programming Interface (API) is composed of several sub APIs offering specialized classes and system routines. Each API has an Object Model and in turn, the object model is a hierarchical system of object interfaces. These object interfaces represent actual objects in the Altium NEXUS.
In the scripting system, we refer to the Object Models because we are only dealing with object interfaces that represent objects in the Altium NEXUS. An object model is a subset of the relevant API. For example, the PCB Object model is part of the PCB API.
The major APIs from the Altium NEXUS API are: Client/Server API, Workspace Manager API, PCB API, Schematic API and Integrated Library API.
For information on using the interfaces from specific Altium NEXUS APIs in scripts see:
Altium NEXUS's open architecture is the DXP platform which allows scripters and third party developers to write and integrate their modules into the environment, with API access to the Schematic editor, PCB editor and other server extensions.
Several major software technologies are used in Altium NEXUS: the client/server architecture technology, APIs, DXP Object Models, and object oriented technologies.
Altium NEXUS provides a hybrid interface model, which exposes the functionality of a dynamic linked library (DLL) module to both a user and the client executable system. The servers themselves are built using the Altium NEXUS API.
The Client executable is a standalone executable system that collaborates with loaded DLL servers within Altium NEXUS. The Client module controls the user interface and delegates tasks (sends commands) to appropriate servers, while servers (as dynamic linked library files) concentrate solely on providing specific functionality based on the Altium NEXUS commands invoked by the user.
An editor server provides its services within Altium NEXUS. The DXP platform interprets the tasks in terms of commands and then delegates these commands to the appropriate server.
The server responds by activating its required functionality on the currently focused design document.
For example, when a user clicks on the Schematic menu to place a wire, the system interprets this action as a
Sch:PlaceWire command and delegates the command to the Schematic Editor.
The Schematic server responds by executing the command. The functionality of a server that is installed in Altium NEXUS is exposed by that server's processes and its exposed functions.
The Workspace Manager module is a system extensions server coupled tightly with the client module within Altium NEXUS. The Workspace Manager server deals with projects and their associated documents, and provides compiling, multi sheet design support, connectivity navigation tools, multi-channel support, multiple implementation documents and so on. It also manages output generators such as netlisters.
The Schematic server and PCB server are two main document editors which have their own document types (design and library documents).
Managing the locations of footprints or symbols from the library documents is performed by the Integrated Library server.
There are two representations of a design document in Altium NEXUS: projects and documents dealt with by the Workspace Manager, and the server documents dealt with by the associated servers (as shown in the above image).
The scripting engine in Altium NEXUS supports PCB, Schematic and Workspace Manager APIs which enables you to write scripts that act on PCB or Schematic documents, or invoke one of the file management routines to massage the documents in a project.
A DelphiScript Script which counts Pad Objects on a PCB document
Procedure PadCount; Var Board : IPCB_Board; Pad : IPCB_Primitive; Iterator : IPCB_BoardIterator; PadNumber : Integer; Begin PadNumber := 0; // Retrieve the current board Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; // 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); // Display the count result on a dialog. ShowMessage('Pad Count = ' + IntToStr(PadNumber)); End;
VBScript Script which creates a new via object on a PCB document
Sub ViaCreation Dim Board Dim Via Set Board = PCBServer.GetCurrentPCBBoard If Board is Nothing Then Exit Sub ' 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 this via in the Board object Board.AddPCBObject(Via) End Sub
See the Overview & Setup of the Scripting System document for a scripting overview.
The downloadable Script Examples collection has a large number of examples that demonstrate how scripts with different API functions work within the Altium NEXUS framework.
The Altium NEXUS scripting system implements a subset of the complete Altium NEXUS API and its Object Interfaces. The Altium DXP Developer, used for developing Altium NEXUS server Extensions, has access to the full Altium NEXUS API via a set of API SDK source units.
In Altium NEXUS, each API (such as the PCB API) has an Object Model and in turn, the object model is a hierarchical system of object interfaces. These object interfaces represent actual objects in the Altium NEXUS (such as the board, document, PCB objects etc).
The projects and the corresponding documents are managed by the Workspace Manager. As indicated in the above image, a project open in Altium NEXUS is represented by the
IProject object interface, and the documents from this project are represented by the
IDocument interfaces. Also:
Object Interfaces are implementation independent declarations of functionality. From a developer’s perspective, there are high level object interfaces which encapsulate certain system objects in Altium NEXUS system such as
IServerModule interfaces, which can be used to extract data for further processing by other servers.
Contact our corporate or local offices directly.