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 免费试用
Altium Designer 免费试用
我们开始吧!首先,您或者您的公司已经在使用Altium Designer了吗?

如果您有任何需求,请点击这里联系获取当地办公室销售代表联系方式。.
Copyright © 2018 Altium Limited

既然您在使用Altium Designer,为何仍需要试用?

如果您有任何需求,请点击这里联系获取当地办公室销售代表联系方式。.
Copyright © 2018 Altium Limited

好的,实际上您无需下载一个试用版本。

点击下方按钮下载最新版本的Altium Designer安装包

下载Altium Designer 安装包

如果您有任何需求,请点击这里联系获取当地办公室销售代表联系方式。.
Copyright © 2018 Altium Limited

填写下方表格,获取Altium Designer最新报价。

点击[获取免费试用],并同意我们的隐私政策。您会接收到来自Altium的资讯,并允许其改变您的通知首选项。

如果您是Altium维保期内客户,您不需要下载试用版本。

如果您不是Altium维保客户,请填写下方表格免费试用。

点击[获取免费试用],并同意我们的隐私政策。您会接收到来自Altium的资讯,并允许其改变您的通知首选项。

您为何想要试用Altium Designer?

如果您有任何需求,请点击这里联系获取当地办公室销售代表联系方式。.
Copyright © 2018 Altium Limited

那您来对地方了!请填写下方表格申请试用吧。

点击[获取免费试用],并同意我们的隐私政策。您会接收到来自Altium的资讯,并允许其改变您的通知首选项。

听上去很棒!您知道我们为学生提供了特殊折扣么?欲知详情,请点击这里。.

同时,请填写下方表格申请免费试用吧。

点击[获取免费试用],并同意我们的隐私政策。您会接收到来自Altium的资讯,并允许其改变您的通知首选项。

好的,您可以下载免费的Altium Designer Viewer查看文档,有效期6个月。

请填写下方表格申请。

点击[获取免费试用],并同意我们的隐私政策。您会接收到来自Altium的资讯,并允许其改变您的通知首选项。

好棒!创作是一件超酷的事情,我们可以为您提供完美的设计软件。

Upverter是一个社区导向的交流平台,专为您这样的创客量身定做。

点击这里看看吧!

如果您有任何需求,请点击这里联系获取当地办公室销售代表联系方式。.
Copyright © 2018 Altium Limited

好的,您可以下载免费的Altium Designer Viewer查看文档,有效期6个月。

请填写下方表格申请。

点击[获取免费试用],并同意我们的隐私政策。您会接收到来自Altium的资讯,并允许其改变您的通知首选项。