An Overview of the Altium SDK

 

Altium Designer's SDK (Software Development Kit) provides the core resources you need to build software Extensions that plug in to Altium Designer and extend its functionality. Software extensions, which are Servers in Altium Designer's Client/Server architecture, can act as independent modules, output generators and document editors that access their own design documents in Altium Designer.

The SDK provides the API (Application Programming Interface) source units, documents and source code examples that allow you to develop your own software extension easily. They are built and compiled as DLLs (Dynamic Link Libraries) using Embarcadero Delphi, Microsoft C# or C++.

Note that the Altium SDK is installed as part of the Altium Developer extension. See the Related documents list above for more information.

With the SDK, a software Extension can be developed to provide a wide range of specialized functionality for Altium Designer, including for the existing design document editors such as the PCB editor. To work with the PCB editor for example, you would use the SDK's PCB API within your software extension project.

The Altium Designer SDK is composed of three parts;

  • Altium Designer SDK's API source files
  • Extension server examples
  • Altium Designer SDK documentation

Software modules developed with the SDK are generally referred to as Extensions and Servers in these documents.

The extension servers can be implemented in a number of forms, depending on their functionality and how they integrate with Altium Designer. They can act as design editor add-ons, stand-alone file manipulators and editors, output generator plug-ins, workspace enhancements and much more.

All are plug-in servers in the Altium Designer client-server architecture, and all extend Altium Designer's functionality.

The Altium Designer SDK

The elements of the SDK

The Altium Designer SDK is composed of source units, which are in turn composed of different sets of APIs and standalone routines. These units give you access to the system's object-oriented structures (for example a pad, track and text objects contained on a PCB design document).

The API source units for Delphi, C# and C++ can be found in their matching directories in the C:\ProgramData\Altium\Altium Designer {xxx}\Extensions\Altium Developer\SDK directory, where xxx represents Altium Designer's installation GUID. When you want to use a particular function or interface from the SDK, the unit that the specific function or class interface is associated with must be added in the 'Uses' (Delphi), 'using' (C#) or '#include' (C++) clause of your project. Go to the SDK installation's \Source Code folders (for the desired language) to check the respective declaration type.

The software IDEs recommended for building Altium Designer software extensions are:

  • Embarcadero Delphi XE2 or newer, for the Delphi SDK 
  • Microsoft Visual Studio 2010 or newer, for the C++/C# SDK

Example projects

The examples folders in the SDK installation contain a number of different types of example projects, with full source code. The projects use PCB and Schematic APIs to enhance the functionality of PCB and Schematic Editors respectively. There are also standalone (not tied to an Editor) software project examples. You can find the Delphi, C++ and C# examples code in their respective SDK[nn]\*language*\Examples\folder, where [nn] represents the Altium SDK version number.

Other SDK documentation

In the Altium Documentation's SDK section there are more documents to help you get up to speed with building software extensions for Altium Designer:

Altium Designer Architecture

The Altium Designer integrated application has a number of main modules: the DXP Platform as the client module, and the 'loaded' server modules. Along with the Workspace manager, the normal server modules are document editors such as the PCB and Schematic design editors plus added extension modules.

The DXP Platform, as the client module, is a standalone executable subsystem that collaborates with loaded servers, which in turn, represent document editors and other software Extensions that provide specialized services within the system. The DXP Platform is a process-centric environment, where server module processes invoked by the user through the platform's User Interface is dispatched to an appropriate module automatically. So when you execute a command, the DXP Platform sends the command to the appropriate software extension, and it responds by activating its required functionality.

The SDK exposes Altium Designer's internal objects using a set of APIs and interfaces. Basically, an object/class interface references an existing object instance in memory, and can be seen as a wrapper around the object that provides controlled access to a third party developer.

Altium Designer Interfaces

The Altium Designer SDK is composed of various APIs along with general routines and classes. Each API is composed of object classes. For example the SDK has the PCB API, which exposes object interfaces representing PCB objects such as pads and PCB documents.

Altium Designer SDK and its APIs

  • Client and Server API – for implementing a custom server plug-in or a document editor.
  • Work-Space Manager API – for dealing with projects and documents.
  • PCB API – for dealing with PCB documents and the PCB objects on them.
  • Schematic API – for dealing with Schematic documents and the Schematic objects on them.
  • Integrated Library API – for dealing with library links and building model editors.
  • Other APIs – such as the BOM Engine and Output Generator API.

Client / Server Interfaces

The DXP Platform as the client module is represented by its IClient interface, and document editors as servers are represented by its IServerModule interfaces. The DXP Platform interfaces derive their functionality from the EDPClasses unit. The Client function is invoked from this unit and this function returns the IClient interface.

WorkSpace Manager Interfaces

The Work-Space Manager interface derives its functionality from the EDPInterfaces unit. To have access to data within the Work-space Manager, you need to have access to the IWorkSpace interface. To have access to the IWorkSpace interface, invoke the EDPUtil – GetWorkspace function which returns the IWorkspace interface.

PCB Interfaces

The PCB interfaces refer to PCB documents and the objects on them. The PCB API derives its functionality from the EDPClasses_PCB unit. To have access to data within the PCB editor, you need to have access to the IPCB_ServerInterface interface. Invoking the PCBServer function will return the IPCB_ServerInterface interface.

Schematic Interfaces

The Schematic interfaces refer to opened Schematic documents and the objects on them. The Schematic API derives its functionality from the EDPClasses_SCH unit. To have access to data within the Schematic editor, you need to have access to the ISch_ServerInterface interface. The SchServer function returns the ISch_ServerInterface interface.

Integrated Library Interfaces

Each schematic component can have models from one or more design domains. A schematic component can also have multiple models per domain, one of which will be the relevant model for that domain.

BOM Engine Interfaces

The Bill Of Materials (BOM) Interfaces allow the creation and management of project BOM data and associated parameters. The main class is the BOM Manager (IBomManager) , called for a specific document data source type by the IBomManagerFactory ( EDP.Utils.GetBomManagerFactory()).

  • See BOM Engine Interfaces for SDK usage information.
  • Access the C# BOMPanel example project for coding information. The example is located in the Developer installation's ..\SDK4.0\CSharp\Examples\BOMPanel folder.

Altium Designer SDK Units

Effectively, the Altium Designer SDK has several sub SDKs, which can be found in the source code folders for each supported development language.

These are arranged in two main groups within the installed SDK:

    1. The DXP platform SDK units

    2. The Electronic Data Platform (EDP) SDK units, incorporating:

  • PCB Editor SDK
  • Schematic Editor SDK
  • Embedded SDK
  • ...and so on.

– For a look at Altium Designer's core SDK and its Delphi object interface types, see the Delphi SDK Reference section.

Exposing an extension's functions to Altium Designer

All the functions in a software extension that are available to the user, such as placing a primitive, changing the zoom level and so on, are performed by commands. When you select a menu item or click on a toolbar button, you are launching a command in Altium Designer. These commands are routed to the appropriate server so it can execute the command. Commands are server process strings which are made up of two parts separated by a colon, in the following format: name : process.

In essence, an extension server working in the Altium Designer client/server system is supported by its own set of processes, which act as a link between Altium Designer and this server. Each server process string can be tied to a User Interface element such as a hot key, menu item or a toolbar button. All of these processes are stored in a server installation file (a text file with an INS extension) that must exist along with the software extension (the compiled DLL) in the extension' installation folder.

To build and deploy a software extension for Altium Designer, you will need the Altium Developer extension (which incorporates the Altium Designer SDK) and an IDE for Delphi, C++ or C# (as outlined above). The compiled DLL server extension normally requires two configuration files (INS and RCS file extensions) to specify the way it interfaces to Altium Designer.

To sum up

With the Altium Developer, the Altium Designer SDK, and a Delphi, C# or C++ IDE, you can build and deploy your own software extensions to implement custom functionality and processes for Altium Designer.

In terms of Interfaces, you need to utilize the EDP API and PCB API to work with PCB design documents and objects, and you need the EDP API and Schematic API to work with Schematic design documents and objects. You only need to use the EDP API if you want to develop your own standalone sever extension, such as a simulation product.

Content