Skip to main content

IWorkspace interface

The IWorkspace interface represents the Work-Space manager in the Altium Designer which deals with project and documents and their related attributes and options. This interface object is the starting point and upon querying this object, it can return currently open projects, number of projects, installed libraries, and create a new document for example.

public interface IWorkspace : IDMObject

Namespace: EDP · Assembly: Altium.SDK.Interfaces

Inherits: IDMObject

Remarks​

Remember the projects need to be compiled first, before you can invoke the GetWorkSpace method to obtain the IWorkSpace interface and its descendant interfaces which represent actual objects in Altium Designer.

It is highly recommended not to hold an interface of the Workspace manager, but re-query the work-space manager every-time the access to the information within is required.

Methods​

MethodReturnsDescription
DM_AddDocumentToActiveProjectvoidThis method adds an existing document with its valid full path into an active project within Altium Designer.
DM_AddOutputLinevoidOutputs the line to the output's dialog.
DM_ChangeManagerIChangeManagerReturns the Engineering Change Order Manager interface object which compares with two projects and creates an ECO to perform a pin swapping process to synchronize the specified two projects.
DM_ClearOutputLinesvoidClears out the Output Memo.
DM_CloseProjectvoid
DM_CreateHarnessDefinitionList_DeviceSheetsIHarnessDefinitionList
DM_CreateNewDocumentstringThis method creates a new document based on the Document Kind.
DM_DestroyHarnessDefinitionListvoid
DM_DisplayNavigationHintvoid
DM_FileOwnership_BulkWarnEndvoid
DM_FileOwnership_BulkWarnRegisterbool
DM_FileOwnership_BulkWarnStartvoid
DM_FocusedDocumentIDocumentReturns the focussed document interface object (if any) in Altium Designer.
DM_FocusedProjectIProjectReturns the focussed project (if any) in Altium Designer.
DM_FreeDocumentsProjectIProjectReturns the IProject interface that contains free documents.
DM_GenerateUniqueIDstringInvoke this method, and a generated Unique ID will be returned which can be used for any newly created or existing object in Altium Designer.
DM_GetDefaultPcbTypestring
DM_GetDifferenceTypeDescriptionstring
DM_GetDocumentFromPathIDocumentRetrieves the IDocument interface object by passing the full document path to this document.
DM_GetOutputCharCountint
DM_GetOutputJobDocumentByPathIWSM_OutputJobDocument
DM_GetOutputLinestring
DM_GetOutputLineCountintReturns the number of output lines in the Output dialog.
DM_GetProjectDialogsFactoryIProjectDialogsFactory
DM_GetProjectFromPathIProjectRetrieves the IProject interface object by passing the full project path to this project.
DM_GetRecoveryIntervalintReturns the number of minutes as the interval when the recovery mechanism kicks in.
DM_GetRecoveryIsEnabledboolReturns a Boolean value whether the recovery mechanism is active or not.
DM_GetReleaseManagerIReleaseManager
DM_GetVaultReleaseManagerIVaultConfigurationReleaseManager
DM_HideProjectvoid
DM_ImageIndexForDocumentKindintReturns the image index depending on the document kind for example PCB, CAM etc.
DM_InstalledLibrariesIDocumentReturns an indexed library (currently installed in Altium Designer only), to be used in conjunction with the DM_InstalledLibraryCount.
DM_InstalledLibraryCountintReturns the number of installed libraries in Altium Designer.
DM_IsReferencedAsDeviceSheetbool
DM_LoadProjectHiddenIProject
DM_LocalHistoryManagerILocalHistoryManager
DM_MessagesManagerIDXPMessagesManagerThis method returns you the interface to the Messages panel in Altium Designer.
DM_Navigation_OpenHostDocumentsvoid
DM_NavigationZoomPrecisionint
DM_NotifyObjectNavigatedvoid
DM_NotifyObjectsNavigatedvoid
DM_OpenProjectIProjectOpens a project with the full project path and set this project in focus depending on its Show parameter.
DM_OptionsStorageIOptionsStorageRepresents a options storage container where Altium Designer can use to retrieve and store options for storing parameters of EDE options such as Toolchain name, folder and default options and project…
DM_PCBReleaseViewDocumentIReleaseViewDocument
DM_PreferencesIWorkspacePreferences
DM_ProjectCountintReturns the number of projects open in Altium Designer.
DM_ProjectsIProjectReturns the indexed project (currently loaded in Altium Designer only), to be used in conjunction with the DM_ProjectCount interface.
DM_PromptForDefaultPcbTypebool
DM_RegisterDependentDocumentsvoid
DM_RunOpenDocumentDialogbool
DM_SetNavigationZoomPrecisionvoid
DM_SetRecoveryParametersvoidSet the interval when the autosave / recovery mechanism in Altium Designer kicks in.
DM_SetRightClickCompStructurevoid
DM_ShowMessageViewvoidInvoke this method to refresh the Message panel.
DM_ShowProjectvoid
DM_ShowToDoListvoidThis method displays the To Do List manager panel.
DM_ViolationTypeDescriptionstringReturns the violation type description string with the error kind value passed in.
DM_ViolationTypeGroupTErrorGroupReturns the error group for which this error kind parameter belongs to.
DM_WorkspaceFileNamestringReturns the filename only of the workspace.
DM_WorkspaceFullPathstringReturns the full path of the workspace.

DM_AddDocumentToActiveProject​

This method adds an existing document with its valid full path into an active project within Altium Designer.

void DM_AddDocumentToActiveProject(string argDocumentPath);
ParameterTypePassing
argDocumentPathstringvalue

Returns: nothing (void)

DM_AddOutputLine​

Outputs the line to the output's dialog. An Internal operation.

void DM_AddOutputLine(string argMessageLine, bool argReplaceLastLine, bool argUpdateLastLine);
ParameterTypePassing
argMessageLinestringvalue
argReplaceLastLineboolvalue
argUpdateLastLineboolvalue

Returns: nothing (void)

DM_ChangeManager​

Returns the Engineering Change Order Manager interface object which compares with two projects and creates an ECO to perform a pin swapping process to synchronize the specified two projects.

IChangeManager DM_ChangeManager();

Returns: IChangeManager

Extension method of IWorkspaceHelper (using EDP;).

DM_ClearOutputLines​

Clears out the Output Memo. An Internal operation.

void DM_ClearOutputLines();

Returns: nothing (void)

DM_CloseProject​

No description yet.

void DM_CloseProject(string argProjectPath);
ParameterTypePassing
argProjectPathstringvalue

Returns: nothing (void)

DM_CreateHarnessDefinitionList_DeviceSheets​

No description yet.

IHarnessDefinitionList DM_CreateHarnessDefinitionList_DeviceSheets(string argFolderPath, bool argRecursive);
ParameterTypePassing
argFolderPathstringvalue
argRecursiveboolvalue

Returns: IHarnessDefinitionList

Extension method of IWorkspaceHelper (using EDP;).

DM_CreateNewDocument​

This method creates a new document based on the Document Kind. The Kinds include - 'PCBLIB','PCB','SCH','SCHLIB' and so on depending on which document servers are installed in Altium Designer.

string DM_CreateNewDocument(string argDocKind);
ParameterTypePassing
argDocKindstringvalue

Returns: string

Example: Create a new PCB document.

using DXP;
using EDP;

var workspace = DXP.GlobalVars.Client.GetDXPWorkspace() as IWorkspace;
if (workspace == null)
return;
workspace.DM_CreateNewDocument("PCB");

Examples: Extension_CreateProject

DM_DestroyHarnessDefinitionList​

No description yet.

void DM_DestroyHarnessDefinitionList(IHarnessDefinitionList argHarnessDefinitionList);
void DM_DestroyHarnessDefinitionList(object argHarnessDefinitionList);
ParameterTypePassing
argHarnessDefinitionListIHarnessDefinitionListvalue

Returns: nothing (void)

The first overload is an extension method of IWorkspaceHelper (using EDP;) with typed parameters; the second is declared by the interface.

DM_DisplayNavigationHint​

No description yet.

void DM_DisplayNavigationHint(UIntPtr argViewHandle, int argX, int argY, IDMObject argDMObject, UIntPtr argViewNavigatedHandle);
void DM_DisplayNavigationHint(object argViewHandle, int argX, int argY, object argDMObject, object argViewNavigatedHandle);
ParameterTypePassing
argViewHandleUIntPtrvalue
argXintvalue
argYintvalue
argDMObjectIDMObjectvalue
argViewNavigatedHandleUIntPtrvalue

Returns: nothing (void)

The first overload is an extension method of IWorkspaceHelper (using EDP;) with typed parameters; the second is declared by the interface.

DM_FileOwnership_BulkWarnEnd​

No description yet.

void DM_FileOwnership_BulkWarnEnd(TFileOwnershipWarningLevel argWarningLevel);
void DM_FileOwnership_BulkWarnEnd(int argWarningLevel);
ParameterTypePassing
argWarningLevelTFileOwnershipWarningLevelvalue

Returns: nothing (void)

The first overload is an extension method of IWorkspaceHelper (using EDP;) with typed parameters; the second is declared by the interface.

DM_FileOwnership_BulkWarnRegister​

No description yet.

bool DM_FileOwnership_BulkWarnRegister(string argFileName);
ParameterTypePassing
argFileNamestringvalue

Returns: bool

DM_FileOwnership_BulkWarnStart​

No description yet.

void DM_FileOwnership_BulkWarnStart();

Returns: nothing (void)

DM_FocusedDocument​

Returns the focussed document interface object (if any) in Altium Designer. A focussed document is a document that is currently open and in focus (this document is active).

IDocument DM_FocusedDocument();

Returns: IDocument

Extension method of IWorkspaceHelper (using EDP;).

Examples: Extension_TestPortHarnessDev

DM_FocusedProject​

Returns the focussed project (if any) in Altium Designer.

IProject DM_FocusedProject();

Returns: IProject

Extension method of IWorkspaceHelper (using EDP;).

Examples: Ciiva, Extension_AddVariant, Extension_CreateProject, Extension_CreateVariantComponent, Extension_GenerateGerber, Extension_HierarchicalDesign, Extension_RefreshDocument, Extension_TestPortHarnessDev

DM_FreeDocumentsProject​

Returns the IProject interface that contains free documents. A free document is a standalone document that lives in the Free Documents project.

IProject DM_FreeDocumentsProject();

Returns: IProject

Extension method of IWorkspaceHelper (using EDP;).

DM_GenerateUniqueID​

Invoke this method, and a generated Unique ID will be returned which can be used for any newly created or existing object in Altium Designer. Objects in Schematic have their own Unique IDs which are tracked by the synchronizator so that the objects on the PCB document are sychronized to their equivalents in a corresponding schematic project.

string DM_GenerateUniqueID();

Returns: string

Example - an incomplete example that assigns new UIDs to Schematic components

Example: Give every component on the current schematic sheet a new unique ID.

using DXP;
using EDP;
using SCH;

// The workspace manager generates the unique IDs.
var workspace = DXP.GlobalVars.Client.GetDXPWorkspace() as IWorkspace;
if (workspace == null)
return;
ISch_Document currentSheet = SCH.GlobalVars.SchServer?.GetCurrentSchDocument();
if (currentSheet == null)
return;

// Set up an iterator to look for components on the sheet.
ISch_Iterator iterator = currentSheet.SchIterator_Create();
iterator.AddFilter_ObjectSet(new SCH.TObjectSet { SCH.TObjectId.eSchComponent });
try
{
for (var component = iterator.FirstSchObject() as ISch_Component; component != null; component = iterator.NextSchObject() as ISch_Component)
component.SetState_UniqueId(workspace.DM_GenerateUniqueID());
}
finally
{
currentSheet.SchIterator_Destroy(ref iterator);
}

DM_GetDefaultPcbType​

No description yet.

string DM_GetDefaultPcbType();

Returns: string

DM_GetDifferenceTypeDescription​

No description yet.

string DM_GetDifferenceTypeDescription(TDifferenceKind argDifferenceKind);
string DM_GetDifferenceTypeDescription(int argDifferenceKind);
ParameterTypePassing
argDifferenceKindTDifferenceKindvalue

Returns: string

The first overload is an extension method of IWorkspaceHelper (using EDP;) with typed parameters; the second is declared by the interface.

DM_GetDocumentFromPath​

Retrieves the IDocument interface object by passing the full document path to this document. With this IDocument interface, you have access to its functionality, such as compiling the document itself.

IDocument DM_GetDocumentFromPath(string argDocumentPath);
ParameterTypePassing
argDocumentPathstringvalue

Returns: IDocument

Extension method of IWorkspaceHelper (using EDP;).

Examples: Ciiva

DM_GetOutputCharCount​

No description yet.

int DM_GetOutputCharCount();

Returns: int

DM_GetOutputJobDocumentByPath​

No description yet.

IWSM_OutputJobDocument DM_GetOutputJobDocumentByPath(string argPath);
ParameterTypePassing
argPathstringvalue

Returns: IWSM_OutputJobDocument

Extension method of IWorkspaceHelper (using EDP;).

DM_GetOutputLine​

No description yet.

string DM_GetOutputLine(int argIndex);
ParameterTypePassing
argIndexintvalue

Returns: string

DM_GetOutputLineCount​

Returns the number of output lines in the Output dialog. An Internal operation.

int DM_GetOutputLineCount();

Returns: int

DM_GetProjectDialogsFactory​

No description yet.

IProjectDialogsFactory DM_GetProjectDialogsFactory();

Returns: IProjectDialogsFactory

Extension method of IWorkspaceHelper (using EDP;).

DM_GetProjectFromPath​

Retrieves the IProject interface object by passing the full project path to this project. With this IProject interface, you have access to its interface methods. A project is a container that has links to associated design documents in an organized manner.

IProject DM_GetProjectFromPath(string argProjectPath);
ParameterTypePassing
argProjectPathstringvalue

Returns: IProject

Extension method of IWorkspaceHelper (using EDP;).

Examples: Ciiva

DM_GetRecoveryInterval​

Returns the number of minutes as the interval when the recovery mechanism kicks in.

int DM_GetRecoveryInterval();

Returns: int

DM_GetRecoveryIsEnabled​

Returns a Boolean value whether the recovery mechanism is active or not.

bool DM_GetRecoveryIsEnabled();

Returns: bool

DM_GetReleaseManager​

No description yet.

IReleaseManager DM_GetReleaseManager();

Returns: IReleaseManager

Extension method of IWorkspaceHelper (using EDP;).

DM_GetVaultReleaseManager​

No description yet.

IVaultConfigurationReleaseManager DM_GetVaultReleaseManager(IProject argProject, IVaultConfiguration argConfiguration);
ParameterTypePassing
argProjectIProjectvalue
argConfigurationIVaultConfigurationvalue

Returns: IVaultConfigurationReleaseManager

Extension method of IWorkspaceHelper (using EDP;).

DM_HideProject​

No description yet.

void DM_HideProject(string argProjectPath);
ParameterTypePassing
argProjectPathstringvalue

Returns: nothing (void)

DM_ImageIndexForDocumentKind​

Returns the image index depending on the document kind for example PCB, CAM etc.

int DM_ImageIndexForDocumentKind(string argDocumentKind);
ParameterTypePassing
argDocumentKindstringvalue

Returns: int

DM_InstalledLibraries​

Returns an indexed library (currently installed in Altium Designer only), to be used in conjunction with the DM_InstalledLibraryCount.

IDocument DM_InstalledLibraries(int argIndex);
ParameterTypePassing
argIndexintvalue

Returns: IDocument

Extension method of IWorkspaceHelper (using EDP;).

See also: IWorkspace.DM_InstalledLibraryCount

DM_InstalledLibraryCount​

Returns the number of installed libraries in Altium Designer.

int DM_InstalledLibraryCount();

Returns: int

DM_IsReferencedAsDeviceSheet​

No description yet.

bool DM_IsReferencedAsDeviceSheet(string argFilePath);
ParameterTypePassing
argFilePathstringvalue

Returns: bool

DM_LoadProjectHidden​

No description yet.

IProject DM_LoadProjectHidden(string argProjectPath);
ParameterTypePassing
argProjectPathstringvalue

Returns: IProject

Extension method of IWorkspaceHelper (using EDP;).

DM_LocalHistoryManager​

No description yet.

ILocalHistoryManager DM_LocalHistoryManager();

Returns: ILocalHistoryManager

Extension method of IWorkspaceHelper (using EDP;).

DM_MessagesManager​

This method returns you the interface to the Messages panel in Altium Designer.

IDXPMessagesManager DM_MessagesManager();

Returns: IDXPMessagesManager

Extension method of IWorkspaceHelper (using EDP;).

DM_Navigation_OpenHostDocuments​

No description yet.

void DM_Navigation_OpenHostDocuments(IProject argProject, IInterfaceList argObjectsList, TDocumentOpenMode argDocumentOpenMode);
void DM_Navigation_OpenHostDocuments(object argProject, object argObjectsList, int argDocumentOpenMode);
ParameterTypePassing
argProjectIProjectvalue
argObjectsListIInterfaceListvalue
argDocumentOpenModeTDocumentOpenModevalue

Returns: nothing (void)

The first overload is an extension method of IWorkspaceHelper (using EDP;) with typed parameters; the second is declared by the interface.

DM_NavigationZoomPrecision​

No description yet.

int DM_NavigationZoomPrecision();

Returns: int

DM_NotifyObjectNavigated​

No description yet.

void DM_NotifyObjectNavigated(int argCode, IDMObject argDMObject, TNavigationActionSet argNavigationActionSet);
void DM_NotifyObjectNavigated(int argCode, object argDMObject, ITransportSet argNavigationActionSet);
ParameterTypePassing
argCodeintvalue
argDMObjectIDMObjectvalue
argNavigationActionSetTNavigationActionSetvalue

Returns: nothing (void)

The first overload is an extension method of IWorkspaceHelper (using EDP;) with typed parameters; the second is declared by the interface.

DM_NotifyObjectsNavigated​

No description yet.

void DM_NotifyObjectsNavigated(int argCode, IDMObject argSourceDMObject, TNavigationActionSet argNavigationActionSet, IInterfaceList argDMObjects);
void DM_NotifyObjectsNavigated(int argCode, object argSourceDMObject, ITransportSet argNavigationActionSet, object argDMObjects);
ParameterTypePassing
argCodeintvalue
argSourceDMObjectIDMObjectvalue
argNavigationActionSetTNavigationActionSetvalue
argDMObjectsIInterfaceListvalue

Returns: nothing (void)

The first overload is an extension method of IWorkspaceHelper (using EDP;) with typed parameters; the second is declared by the interface.

DM_OpenProject​

Opens a project with the full project path and set this project in focus depending on its Show parameter.

IProject DM_OpenProject(string argProjectPath, bool argShow);
ParameterTypePassing
argProjectPathstringvalue
argShowboolvalue

Returns: IProject

Extension method of IWorkspaceHelper (using EDP;).

DM_OptionsStorage​

Represents a options storage container where Altium Designer can use to retrieve and store options for storing parameters of EDE options such as Toolchain name, folder and default options and project options.

IOptionsStorage DM_OptionsStorage();

Returns: IOptionsStorage

Extension method of IWorkspaceHelper (using EDP;).

DM_PCBReleaseViewDocument​

No description yet.

IReleaseViewDocument DM_PCBReleaseViewDocument();

Returns: IReleaseViewDocument

Extension method of IWorkspaceHelper (using EDP;).

DM_Preferences​

No description yet.

IWorkspacePreferences DM_Preferences();

Returns: IWorkspacePreferences

Extension method of IWorkspaceHelper (using EDP;).

See also: IWorkspacePreferences

Examples: Extension_VariantOptions

DM_ProjectCount​

Returns the number of projects open in Altium Designer.

int DM_ProjectCount();

Returns: int

DM_Projects​

Returns the indexed project (currently loaded in Altium Designer only), to be used in conjunction with the DM_ProjectCount interface.

IProject DM_Projects(int argIndex);
ParameterTypePassing
argIndexintvalue

Returns: IProject

Extension method of IWorkspaceHelper (using EDP;).

DM_PromptForDefaultPcbType​

No description yet.

bool DM_PromptForDefaultPcbType(ref string argPcbType);
ParameterTypePassing
argPcbTypestringref

Returns: bool

DM_RegisterDependentDocuments​

No description yet.

void DM_RegisterDependentDocuments(string argSourceDocKind, string argDependentExtension);
ParameterTypePassing
argSourceDocKindstringvalue
argDependentExtensionstringvalue

Returns: nothing (void)

DM_RunOpenDocumentDialog​

No description yet.

bool DM_RunOpenDocumentDialog(string argCaption, bool argllowMultiSelect, ref string argPath, TFilterKind argFilterKind, int argFilterIndex, out IStrings argDocumentPaths);
bool DM_RunOpenDocumentDialog(string argCaption, bool argllowMultiSelect, ref string argPath, int argFilterKind, int argFilterIndex, out IStrings argDocumentPaths);
ParameterTypePassing
argCaptionstringvalue
argllowMultiSelectboolvalue
argPathstringref
argFilterKindTFilterKindvalue
argFilterIndexintvalue
argDocumentPathsIStringsout

Returns: bool

The first overload is an extension method of IWorkspaceHelper (using EDP;) with typed parameters; the second is declared by the interface.

DM_SetNavigationZoomPrecision​

No description yet.

void DM_SetNavigationZoomPrecision(int argZoomPrecision);
ParameterTypePassing
argZoomPrecisionintvalue

Returns: nothing (void)

DM_SetRecoveryParameters​

Set the interval when the autosave / recovery mechanism in Altium Designer kicks in. The interval is in minutes, and whether to enable the recovery mechanism.

void DM_SetRecoveryParameters(bool argIsEnabled, int argInterval);
ParameterTypePassing
argIsEnabledboolvalue
argIntervalintvalue

Returns: nothing (void)

DM_SetRightClickCompStructure​

No description yet.

void DM_SetRightClickCompStructure(string argProjectPath, string argLibReference, string argUniqueId);
ParameterTypePassing
argProjectPathstringvalue
argLibReferencestringvalue
argUniqueIdstringvalue

Returns: nothing (void)

DM_ShowMessageView​

Invoke this method to refresh the Message panel.

void DM_ShowMessageView();

Returns: nothing (void)

DM_ShowProject​

No description yet.

void DM_ShowProject(string argProjectPath);
ParameterTypePassing
argProjectPathstringvalue

Returns: nothing (void)

DM_ShowToDoList​

This method displays the To Do List manager panel. This To Do List panel can be used to define your To Dos.

void DM_ShowToDoList();

Returns: nothing (void)

DM_ViolationTypeDescription​

Returns the violation type description string with the error kind value passed in. Check the TErrorKind for its range of values.

string DM_ViolationTypeDescription(TErrorKind argErrorKind);
string DM_ViolationTypeDescription(int argErrorKind);
ParameterTypePassing
argErrorKindTErrorKindvalue

Returns: string

The first overload is an extension method of IWorkspaceHelper (using EDP;) with typed parameters; the second is declared by the interface.

DM_ViolationTypeGroup​

Returns the error group for which this error kind parameter belongs to. Check the TErrorGroup type for its range of values.

TErrorGroup DM_ViolationTypeGroup(TErrorKind argErrorKind);
ParameterTypePassing
argErrorKindTErrorKindvalue

Returns: TErrorGroup

Extension method of IWorkspaceHelper (using EDP;).

DM_WorkspaceFileName​

Returns the filename only of the workspace.

string DM_WorkspaceFileName();

Returns: string

DM_WorkspaceFullPath​

Returns the full path of the workspace.

string DM_WorkspaceFullPath();

Returns: string

Inherited members​

Examples​

Used in the SDK examples: Ciiva, Ciiva, Extension_AddVariant, Extension_CreateProject, Extension_CreateVariantComponent, Extension_GenerateGerber, Extension_HierarchicalDesign, Extension_IComponent_To_ISch_Component, Extension_RefreshDocument, Extension_SchTemplate, Extension_TestPortHarnessDev, Extension_VariantOptions.