Technical Reference - PCB API

Created: June 6, 2016 | Updated: September 26, 2016
Applies to Altium NEXUS Client versions: 3.1, 3.2, 4 and 5
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 (with Altium Designer Enterprise Subscription) and a connected Altium 365 Workspace. Check out the FAQs page for more information.

Parent page: Altium NEXUS API Reference

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.

The PCB Application Programming Interface (API) reference details the object interfaces for PCB objects such as PCB documents and PCB design objects.

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.

The PCB API consists of the PCB Object model and the API functions. The PCB Object Model part of the PCB API is made accessible by the PCB Editor.

The PCB design objects and methods are available in all script languages supported by Altium NEXUS. The PCB design objects are wrapped by their corresponding PCB interfaces which makes it possible to manipulate those objects by scripts and server code.

Object Interfaces

An interface is basically a list of methods that a class declares it implements — that is, each method in the interface is implemented in the corresponding class. Interfaces are declared like classes, but cannot be directly instantiated and do not have their own method definitions.

PCBServer function

To work with PCB design objects, the starting point is to invoke the PCBServer function which returns the IPCB_ServerInterface interface, which represents the PCB Editor. With this interface, all other PCB interfaces can be extracted.

For example to get access to the current PCB document open in Altium NEXUS, you would invoke the GetCurrentPCBBoard method from the IPCB_ServerInterface interface object.

Example: Obtaining the currently open PCB document.

Board := PCBServer.GetCurrentPCBBoard;
  If Board = Nil then Exit;
TheFilename := Board.FileName;
Main PCB Interfaces
  • The IPCB_Primitive interface is a generic ancestor interface for all PCB design object interfaces.
  • The IPCB_Board interface represents an existing PCB document.
  • The IPCB_ServerInterface interface represents the PCB server object.

Script Examples
There are PCB script examples in the \Examples\Scripts\DelphiScripts\PCB folder which demonstrate the use of PCB interfaces.

References for the PCB API

Separate references for other Altium NEXUS APIs

PCB Object Model

The PCB Object Model compromises of PCB Object Interfaces and standalone utility functions that allow you to deal with PCB objects from a PCB document in Altium NEXUS via object interfaces.

An interface is just a means of access to an object in memory. To have access to the PCB server and massage certain PCB design objects, you need to invoke the PCBServer function, which extracts the IPCB_ServerInterface interface.

The IPCB_ServerInterface interface is the main interface and contains many interfaces within. With this interface for example, you can proceed further by iterating for PCB objects on a PCB document.

A simplified PCB Interfaces hierarchy example:

The IPCB_ServerInterface and IPCB_Board interfaces are two of the main interfaces to deal with when accessing and manipulating a PCB document.

See also

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: