Technical Reference - Workspace Manager API

Old Content - visit altium.com/documentation

Parent page: Altium Designer API Reference

This section of the Altium Designer API documentation provides a detailed reference of the Workspace Manager API interfaces.

The Altium Designer scripting system implements a subset of the complete Altium Designer API and its Object Interfaces. The Altium DXP Developer, used for developing Altium Designer server Extensions, has access to the full Altium Designer API via a set of API SDK source units.

The WorkSpace Manager (WSM) Application Programming Interface reference covers the Workspace manager object interfaces from the Workspace Manager Object Model.

The workspace manager interfaces exist as long there are associated existing objects in memory, thus when writing a script or server code, you have the responsibility of checking whether the interface you wish to query exists or not before you proceed to invoke the interface's methods.

You will have to ensure that the design project is compiled first otherwise the workspace manager interfaces are in an invalid state and will be returning nil values.

The workspace manager provides a bridge between source documents (such as Schematic documents) and its corresponding primary implementation documents (such as PCB documents). This workspace manager provides you information on how a project is structured, and information on nets and its associated net aware objects of source and implementation documents.

The IWorkSpace interface deals with projects, documents and objects on the open documents. To use workspace interfaces, the project needs to be compiled first refreshing all the linkages and nets up to date.

Main WSM interfaces

  • The IDMObject interface is a generic interface used for all other WorkSpace interfaces.
  • The IWorkSpace interface is the top level interface and contains many interfaces within. For example the IWorkSpace interface has a DM_OpenProject function which returns a currently open or currently focused IProject interface.
  • The IProject interface represents the current project in Altium Designer.
  • The IDocument interface represents a document in Altium Designer.

Logical and Physical Documents

An important note, there are logical and physical documents; these terms are used to differentiate the documents in multi-channel projects. A multi channel design means that a single sheet is referenced repeatedly for a channel design. This sheet is called a logical document. A physical document (usually a PCB document) has components with unique names within a room which is mapped to a channel on a Schematic sheet. So a multi channel design translates to multiple rooms with components with unique physical designators on a PCB.

A physical designator of a PCB component is calculated to have the hierarchy path of a schematic project as well as the logical designator of the associated Schematic component to ensure that this designator for the PCB component is unique.

Example
Obtaining the project path from the current IProject interface.

// Get WSM interface (the shell of the WorkSpace Manager interface).
WSM := GetWorkSpace;
If WSM = Nil Then Exit;
Document := WSM.DM_Document;
If Document = Nil The Exit;
Project := Document.DM_Project;

Script Examples
There are script examples in the \Examples\Scripts\WSM folder

References for the WSM API

Separate references for other Altium Designer APIs

WSM Object Model

To have access to the workspace interface object which represents the workspace manager in Altium Designer, you need to invoke the GetWorkspace function first. This function returns you the IWorkspace interface object. An object interface is just a means of access to an object in memory.

The workspace manager provides a bridge between source documents (such as Schematic documents) and its corresponding primary implementation documents (such as PCB documents). This workspace manager provides you the ability to manipulate the contents of a design project in Altium Designer.

WSM Interfaces

A sample of the workspace manager interfaces:

  • The IDMObject interface is a generic interface used for all other WorkSpace interfaces.
  • The IWorkSpace interface is the top level interface and contains many interfaces within. For example the IWorkSpace interface has a DM_OpenProject function which returns a currently open or currently focused IProject interface.
  • The IProject interface represents a design project in Altium Designer.
  • The IPart interface represents a part of a multi-part component. This component is represented by the IComponent interface.
  • The IDocument interface represents a document in Altium Designer.
  • The IECO interface is used for the Engineering Change Order system in PCB and Schematic servers.
  • The INet interface is a container storing Net aware objects (which are INetItem interfaces) that have the same net property. So there are INet interfaces representing nets on a document.
  • The INetItem interface is the ancestor interface for the Cross, Pin, Port, Netlabel, Sheet entry and Power Object interfaces. These interface objects have a net property and thus these objects can be part of a net.

 

You are reporting an issue with the following selected text and/or image within the active document:
ALTIUM DESIGNER FREE TRIAL
Altium Designer Free Trial
Let’s get started. First off, are you or your organization already using Altium Designer?

If would like to speak with a representative, please contact your local Altium office.
Copyright © Altium Limited

In that case, why do you need an evaluation license?

If would like to speak with a representative, please contact your local Altium office.
Copyright © Altium Limited

Got it. You actually don’t need an evaluation license for that.

Click the button below to download the latest Altium Designer installer.


Download Altium Designer Installer

If would like to speak with a representative, please contact your local Altium office.
Copyright © Altium Limited

Please fill out the form below to get a quote for a new seat of Altium Designer.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.

If you are on Altium Subscription, you don’t need an evaluation license.

If you are not an active Altium Subscription member, please fill out the form below to get your free trial.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.

Why are you looking to evaluate Altium Designer?

If would like to speak with a representative, please contact your local Altium office.
Copyright © Altium Limited

You came to the right place! Please fill out the form below to get your free trial started.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.

Sounds exciting! Did you know we offer special discounted student licenses? For more information, click here.

In the meantime, feel free to request a free trial by filling out the form below.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.

Got it. You can download a free Altium Designer Viewer license which is valid for a 6 months.

Please fill out the form below to request one.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.

That’s great! Making things is awesome. We have the perfect program for you.

Upverter is a free community-driven platform designed specifically to meet the needs of makers like you.

Click here to give it a try!

If would like to speak with a representative, please contact your local Altium office.
Copyright © Altium Limited

Got it. You can download a free Altium Designer Viewer license which is valid for a 6 months.

Please fill out the form below to request one.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.