Altium NEXUS Documentation

Technical Reference - Workspace Manager API

Created: June 6, 2016 | Updated: September 26, 2016

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.

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

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 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 NEXUS.
  • The IDocument interface represents a document in Altium NEXUS.

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 NEXUS APIs

WSM Object Model

To have access to the workspace interface object which represents the workspace manager in Altium NEXUS, 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 NEXUS.

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 NEXUS.
  • 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 NEXUS.
  • 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.

 

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: