IProject interface

Overview 
The IProject interface deals with an open project in Altium Designer. There are project and document variants, that is actually a project or document can be specified to have project or document variants (actual project / document variants do not exist) and on these document variants have component variants.
To have access to the data of a project, you need to do a compile first. Projects deal with logical and physical documents. Logical documents are the connected documents which are part of a design which include a PCB document associated with this design. Physical documents are source documents expanded by the Altium Designer compiler as in a flattened design project.
Thus, a project contains source documents and implementation documents. To have access to the most current data of a project, you need to compile the project first. The compiler maps (or expands) all the logical source documents into physical documents.
Normally there is a one logical document to a one physical document for a simple flat design project, but for hierarchical design projects (for example multi channel projects), the documents that have sheet symbols with a Repeat statement, then logical documents are expanded into multiple physical documents.
There are Output jobs consisting of available output generators installed in Altium Designer.

The IProject interface hierarchy is as follows;

IProject methods 

Function DM_Configurations(Index : Integer) : IConfiguration;
Function DM_ProjectVariantCount : Integer;
Function DM_GeneratedDocumentCount : Integer;
Function DM_LogicalDocumentCount : Integer;
Function DM_PhysicalDocumentCount : Integer;
Function DM_SearchPathCount : Integer;
Function DM_DeviceSheetFolderCount : Integer;
Function DM_ConfigurationCount : Integer;
Function DM_IndexOfSourceDocument(Filename : WideString) : Integer;
Procedure DM_MoveSourceDocument(Filename : WideString; NewIndex : Integer);
Procedure DM_AddConfigurationParameters(Configuration : WideString);
Procedure DM_AddConfigurationParameters_Physical(Configuration : WideString);
Procedure DM_AddGeneratedDocument(Filename : WideString);
Procedure DM_AddSourceDocument(Filename : WideString);
Procedure DM_AddControlPanel(Filename : WideString);
Procedure DM_RemoveSourceDocument(Filename : WideString);
Procedure DM_AddSearchPath(SearchPath : WideString; IncludeSubFolders : Boolean);
Procedure DM_AddDeviceSheetFolder(FolderPath : WideString; IncludeSubFolders : Boolea
Function DM_ProjectFullPath : WideString;
Function DM_ProjectFileName : WideString;
Function DM_HierarchyMode : TFlattenMode;
Function DM_ViolationCount : Integer;
Procedure DM_ClearViolations;
Function DM_ErrorLevels(AErrorKind : TErrorKind) : TErrorLevel;
Procedure DM_SetErrorLevels(AErrorKind : TErrorKind; AErrorLevel : TErrorLevel);
Function DM_ChannelDesignatorFormat : WideString;
Function DM_ChannelRoomLevelSeperator : WideString;
Function DM_ChannelRoomNamingStyle : TChannelRoomNamingStyle;
Function DM_UserID : WideString;
Procedure DM_StartNavigation;
Procedure DM_StartCrossProbing(CtrlDoesSwitch : Boolean);
Procedure DM_DoCrossSelection;
Function DM_InitializeOutputPath(AnOutputType : WideString) : WideString;
Procedure DM_SetOutputPath(AnOutputPath : WideString);
Function DM_GetOutputPath : WideString;
Function DM_Compile : LongBool;
Function DM_CompileEx(All : LongBool; Var Cancelled : LongBool) : LongBool;
Function DM_EditOptions(DefaultPage : WideString) : LongBool;
Function DM_EditConfigurations : LongBool;
Function DM_UpdateConstraints : LongBool;
Function DM_OptionsStorage : IOptionsStorage;
Procedure DM_SetAsCurrentProject;
Function DM_GetAllowPortNetNames : Boolean;
Function DM_GetAllowSheetEntryNetNames : Boolean;
Function DM_GetAppendSheetNumberToLocalNets : Boolean;
Procedure DM_SetAllowPortNetNames(AAllow : Boolean);
Procedure DM_SetAllowSheetEntryNetNames(AAllow : Boolean);
Procedure DM_SetAppendSheetNumberToLocalNets(AAppend : Boolean);
Procedure DM_SetHierarchyMode(AFlatten : TFlattenMode);
Function DM_GetConfigurationByName(Configuration : WideString) : IConfiguration;
Function DM_AddConfiguration(Configuration : WideString) : IConfiguration;
Function DM_RemoveConfigurationByName(Configuration : WideString) : Boolean;
Function DM_RemoveAllConfigurations : Boolean;
Function DM_GetDefaultConfiguration : IConfiguration;
Function DM_GetDefaultConfigurationName : WideString;
Procedure DM_SetDefaultConfigurationName(Configuration : WideString);
Function DM_GetDefaultPcbType : WideString;
Procedure DM_SetDefaultPcbType(PcbType : WideString);
Function DM_HierarchyModeForCompile : TFlattenMode;
Procedure DM_RefreshInWorkspaceForm;
Function DM_DocumentBackups : IDocumentBackups;
Function DM_OwnedProjectCount : Integer;
Function DM_GetPinSwapBy_Netlabel : Boolean;
Function DM_GetPinSwapBy_Pin : Boolean;
Procedure DM_SetPinSwapBy_Netlabel(AAllow : Boolean);
Procedure DM_SetPinSwapBy_Pin(AAllow : Boolean);
Procedure DM_RemoveProjectVariant(Index : Integer);
Function DM_InCompilation : Boolean;
Function DM_ProjectTemplateLocation : WideString;
Function DM_ReportSuppressedErrorsInMessages : Boolean;
Function DM_NeedsCompile : LongBool;
Function DM_AvailableDatabaseLinks : Boolean;
Procedure DM_AddParameter(AName : WideString; AValue : WideString);
Procedure DM_ResetReleaseProject;
Function DM_ParameterCount : Integer;
Function DM_IsInferredObject : Boolean;
Function DM_LocationX : Integer;
Function DM_LocationY : Integer;
Function DM_GeneralField : Integer;
Function DM_LocationString : WideString;
Function DM_LongDescriptorString : WideString;
Function DM_ShortDescriptorString : WideString;
Function DM_ObjectKindString : WideString;
Function DM_ObjectKindStringForCrossProbe : WideString;
Function DM_PrimaryCrossProbeString : WideString;
Function DM_SecondaryCrossProbeString : WideString;
Function DM_FullCrossProbeString : WideString;
Function DM_ImageIndex : Integer;
Function DM_OwnerDocumentName : WideString;
Function DM_OwnerDocumentFullPath : WideString;
Function DM_CurrentSheetInstanceNumber : Integer;
Function DM_ValidForNavigation : Boolean;
Function DM_NetIndex_Flat : Integer;
Function DM_NetIndex_Sheet : Integer;
Function DM_NetIndex_SubNet : Integer;
Function DM_SheetIndex_Logical : Integer;
Function DM_SheetIndex_Physical : Integer;
Function DM_IsFormulaString(AFormula : WideString) : Boolean;

Methods

DM_AddConfigurationParameters method 

(IProject interface)
Syntax 
Procedure DM_AddConfigurationParameters(Configuration : WideString);
Description 
A configuration is a list of constraints file which manages the mapping of pins to ports of a FPGA project. Invoke this method to add parameters of a specified configuration file for a FPGA project.
See also 
IProject interface


DM_AddConfigurationParameters_Physical method 
(IProject interface)
Syntax 
Procedure DM_AddConfigurationParameters_Physical(Configuration : WideString);
Description 
A configuration is a list of constraints file which manages the mapping of pins to ports of a FPGA project. Invoke this method to add parameters of a specified configuration file for a FPGA project.
See also 
IProject interface


DM_AddControlPanel method 
(IProject interface)
Syntax 
Procedure DM_AddControlPanel (Filename : WideString);
Description 
The procedure adds a document to the main section of the the panel which could be part of a project or free documents.
See also 
IProject interface


DM_AddGeneratedDocument method 
(IProject interface)
Syntax 
Procedure DM_AddGeneratedDocument (Filename : WideString);
Description 
This procedure adds a new generated document referenced by its filename parameter in this current project, and this document appears in theGenerated folder of this project on Altium Designer Projects panel.
See also 
IProject interface


DM_AddSearchPath method 
(IProject interface)
Syntax 
Procedure DM_AddSearchPath (SearchPath : WideString; IncludeSubFolders : Boolean);
Description 
This procedure adds a new serach path for the current project.
See also 
IProject interface


DM_AddSourceDocument method 
(IProject interface)
Syntax 
Procedure DM_AddSourceDocument (Filename : WideString);
Description 
The procedure adds a source document referenced by its filename parameter in the current project.
See also 
IProject interface


DM_ChannelDesignatorFormat method 
(IProject interface)
Syntax 
Function DM_ChannelDesignatorFormat : WideString;
Description 
This function returns the formatted channel designator string. This string is basedon the settings defined in the Multi-Channel page of the Options for Project dialog from the Project » Project Options menu item.
See also 
IProject interface


DM_ChannelRoomLevelSeperator method 
(IProject interface)
Syntax 
Function DM_ChannelRoomLevelSeperator : WideString;
Description 
The function returns the separator character for the Channel Room Level string. The default is an underline character used for room naming styles when there are paths (based on hierarchical designs).
See also 
IProject interface

DM_ChannelRoomNamingStyle method

(IProject interface)
Syntax 
Function DM_ChannelRoomNamingStyle : TChannelRoomNamingStyle;
Description 
The function returns the TChannelRoomNamingStyle type. There are alternative styles for naming rooms on a PCB document.
See also 
IProject interface


DM_ClearViolations method 
(IProject interface)
Syntax 
Procedure DM_ClearViolations;
Description 
The procedure clears all existing violations within the project.
See also 
IProject interface

DM_Compile method

(IProject interface)
Syntax 
Function DM_Compile : LongBool;
Description 
Invoke this function to compile the current project. Once the project is compiled, navigation of nets and comparing the differences of documents and other tasks can be performed.
See also 
IProject interface


DM_CompileEx method 
(IProject interface)
Syntax 
Function DM_CompileEx(All : LongBool; Var Cancelled : LongBool) : LongBool;
Description 
Invoke this function to compile all documents of all opened projects in Altium Designer. Pass a Boolean parmeter in to cancel the compiling process.
See also 
IProject interface


DM_ComponentMappings method 
(IProject interface)
Syntax 
Function DM_ComponentMappings (AnImplementationDocument : WideString) : IComponentMappings;
Description 
The function returns the IComponentMapping interface which details which PCB components are linked to Schematic components. Check the IComponentMappings interface.
See also 
IProject interface


DM_ConfigurationCount method 
(IProject interface)
Syntax 
Function DM_ConfigurationCount : Integer;
Description 
The function returns the number of configurations for the current project. To be used in conjunction with DM_Configurations function.
Example

See also 
IProject interface


DM_Configurations method 
(IProject interface)
Syntax 
Function DM_Configurations (Index : Integer ) : IConfiguration;
Description 
The function returns the indexed configuration of a FPGA project. A configuration can have a list of different constraint files.
See also 
IProject interface


DM_CurrentProjectVariant method 
(IProject interface)
Syntax 
Function DM_CurrentProjectVariant : IProjectVariant;
Description 
The function returns the current project variant from this current project. Check out the IProjectVariant interface.
See also 
IProject interface


DM_DoCrossSelection method 
(IProject interface)
Syntax 
Procedure DM_DoCrossSelection
Description 
Activates the cross probing function where you can jump from a Schematic object to its corresponding PCB object (both source and primary implementation documents need to be open in Altium Designer).
See also 
IProject interface


DM_DocumentFlattened method 
(IProject interface)
Syntax 
Function DM_DocumentFlattened : IDocument;
Description 
The function returns the flattened document. A flattened document is part of a flattened hierarchy of a project and all objects of this project appear in the Instance list of the Navigator panel.
See also 
IProject interface


DM_EditOptions method 
(IProject interface)
Syntax 
Function DM_EditOptions(DefaultPage : WideString) : LongBool;
Description

Example

See also 
IProject interface


DM_ErrorLevels method 
(IProject interface)
Syntax 
Function DM_ErrorLevels (AErrorKind : TErrorKind) : TErrorLevel;
Description 
The function returns the error level for the specified error type. For each violation type, you can have up to four different error levels, No Report, Warning, Error and Fatal Error with four different colored folders.
See also 
IProject interface


DM_GeneratedDocumentCount method 
(IProject interface)
Syntax 
Function DM_GeneratedDocumentCount : Integer;
Description 
The function returns the number of generated documents such as those documents generated by the OutPut generator (from a OutJob document). Use this function in conjunction with the DM_GeneratedDocuments function.
Example

See also 
IProject interface


DM_GeneratedDocuments method 
(IProject interface)
Syntax 
Function DM_GeneratedDocuments (Index : Integer ) : IDocument;
Description 
The function returns the indexed generated document which is generated by the Output Generator.
See also 
IProject interface


DM_GetAllowPortNetNames method 
(IProject interface)
Syntax 
Function DM_GetAllowPortNetNames : Boolean;
Description 
Invoke this function to check whether port net names are used for navigation in Altium Designer or not.
See also 
IProject interface


DM_GetAllowSheetEntryNetNames method 
(IProject interface)
Syntax 
Function DM_GetAllowSheetEntryNetNames : Boolean;
Description 
Invoke this function to check whether sheet entry net anmes are used for navigation in Altium Designer or not.
See also 
IProject interface


DM_GetAppendSheetNumberToLocalNets method 
(IProject interface)
Syntax 
Function DM_GetAppendSheetNumberToLocalNets : Boolean;
Description 
Invoke this function to check whether sheet numbers are appended to local nets or not.
See also 
IProject interface


DM_GetConfigurationByName method 
(IProject interface)
Syntax 
Function DM_GetConfigurationByName(Configuration : WideString) : IConfiguration;
Description 
The function returns you the configuration object for the project (normally for FPGA projects) if configuration parameter is valid. A configuration file contains mapping information to link from a FPGA project to a linked PCB project.
See also 
IProject interface


DM_GetDefaultConfiguration method 
(IProject interface)
Syntax 
Function DM_GetDefaultConfiguration : IConfiguration;
Description 
The function returns the default configuration for a FPGA project.
See also 
IProject interface


DM_GetDefaultConfigurationName method 
(IProject interface)
Syntax 
Function DM_GetDefaultConfigurationName : WideString;
Description 
Returns the name of the default configuration for a FPGA project
See also 
IProject interface

DM_GetDefaultPcbType method

(IProject interface)
Syntax 
Function DM_GetDefaultPcbType : WideString;
Description

Example

See also 
IProject interface

DM_GetDocumentFromPath method

(IProject interface)
Syntax 
Function DM_GetDocumentFromPath(DocumentPath : WideString) : IDocument;
Description 
This function returns the IDocument interface associated with the document path parameter. Otherwise a Nil value is returned.
See also 
IProject interface


DM_GetOutputPath method 
(IProject interface)
Syntax 
Function DM_GetOutputPath : WideString;
Description 
The function returns the output path for generated documents for the current project.
See also 
IProject interface


DM_GetScrapDocument method 
(IProject interface)
Syntax 
Function DM_GetScrapDocument(DocumentPath : WideString) : IDocument;
Description 
Returns the scrap document for the project. A scrap document is a temporary document used when creating a new document and once a document is saved, the contents of the scrap document is copied and freed.
See also 
IProject interface


DM_HierarchyMode method 
(IProject interface)
Syntax 
Function DM_HierarchyMode : TFlattenMode;
Description 
This function returns the hierarchy mode as a TFlattenMode parameter.
See also 
IProject interface


DM_HierarchyModeForCompile method 
(IProject interface)
Syntax 
Function DM_HierarchyModeForCompile : TFlattenMode;
Description

Example

See also 
IProject interface


DM_IndexOfSourceDocument method 
(IProject interface)
Syntax 
Function DM_IndexOfSourceDocument(Filename : WideString) : Integer;
Description 
The function returns the index of the source document based on the filename of this document. This is for hierarchical or connected schematic documents.
See also 
IProject interface


DM_InitializeOutputPath method 
(IProject interface)
Syntax 
Function DM_InitializeOutputPath(AnOutputType : WideString) : WideString;
Description 
The function returns the output path for the Output Generator based on the AnOutputType parameter.
See also 
IProject interface


DM_LogicalDocumentCount method 
(IProject interface)
Syntax 
Function DM_LogicalDocumentCount : Integer;
Description 
The function returns the number of logical documents which represent the actual documents of a design project (documents that exist in the design project but are not part of the design are not logical documents). Use this function in conjunction with the DM_LogicalDocuments function.
See also 
IProject interface


DM_LogicalDocuments method 
(IProject interface)
Syntax 
Function DM_LogicalDocuments (Index : Integer ) : IDocument;
Description 
The function returns the indexed logical document of a project.
See also 
IProject interface


DM_MoveSourceDocument method 
(IProject interface)
Syntax 
Procedure DM_MoveSourceDocument (Filename : WideString; NewIndex : Integer);
Description 
The procedure re-assigns the source document referenced by the filename a new index number.
See also 
IProject interface


DM_NavigationZoomPrecision method 
(IProject interface)
Syntax 
Function DM_NavigationZoomPrecision : Integer;
Description 
Sets how precise the document zoom is when the interactive navigator is being used to trace the connection in a project.
See also 
IProject interface

DM_OptionsStorage method

(IProject interface)
Syntax 
Function DM_OptionsStorage : IOptionsStorage;
Description

Example

See also 
IProject interface
DM_Outputers method 
(IProject interface)
Syntax 
Function DM_Outputers (Name : WideString) : IOutputer;
Description 
The function returns the indexed Output Generator. An output generator could be a Simple BOM.
See also 
IProject interface

DM_PhysicalDocumentCount method

(IProject interface)
Syntax 
Function DM_PhysicalDocumentCount : Integer;
Description 
The function returns the number of physical source documents (which are expanded logical documents of the design project). Source documents are usually schematic documents. Use this function in conjunction with the DM_PhysicalDocuments function.
See also 
IProject interface


DM_PhysicalDocuments method 
(IProject interface)
Syntax 
Function DM_PhysicalDocuments (Index : Integer ) : IDocument;
Description 
The function returns the indexed physical document of a project.
See also 
IProject interface


DM_PrimaryImplementationDocument method 
(IProject interface)
Syntax 
Function DM_PrimaryImplementationDocument : IDocument;
Description 
The function returns the primary implementation document for example PCB documents. Source documents are Schematic documents for example.
See also 
IProject interface


DM_ProjectFileName method 
(IProject interface)
Syntax 
Function DM_ProjectFileName : WideString;
Description 
This function returns the file name of this current project in Altium Designer.
See also 
IProject interface


DM_ProjectFullPath method 
(IProject interface)
Syntax 
Function DM_ProjectFullPath : WideString;
Description 
This function returns the full path of this current project in Altium Designer.
See also 
IProject interface


DM_ProjectVariantCount method 
(IProject interface)
Syntax 
Function DM_ProjectVariantCount : Integer;
Description 
The function returns the number of project variants for this current project.
See also 
IProject interface


DM_ProjectVariants method 
(IProject interface)
Syntax 
Function DM_ProjectVariants (Index : Integer ) : IProjectVariant;
Description 
The function returns the indexed IProjectVariant interface. A project variant interface is only a conceptual representation of a project that can have project variants. That is there is only one physical board but this same board can have certain components disabled or enabled leading to document variants. The variations of a PCB board are referred to as the IDocumentVariant and to check which components are enabled or not for this particular document variant, check out the IComponentVariant interface.
This is to be used in conjunction with the DM_ProjectVariantCount method.
See also 
IProject interface


DM_RemoveSourceDocument method 
(IProject interface)
Syntax 
Procedure DM_RemoveSourceDocument (Filename : WideString);
Description 
This procedure removes a source document referenced by its filename from this current project.
See also 
IProject interface


DM_SearchPathCount method 
(IProject interface)
Syntax 
Function DM_SearchPathCount : Integer;
Description 
The function returns the number of search paths for this current project. Use this function in conjunction with the DM_SearchPaths function.
See also 
IProject interface


DM_SearchPaths method 
(IProject interface)
Syntax 
Function DM_SearchPaths (Index : Integer ) : ISearchPath;
Description 
The function returns the indexed search path object defined for this project.
See also 
IProject interface


DM_SetAllowPortNetNames method 
(IProject interface)
Syntax 
Procedure DM_SetAllowPortNetNames (AAllow : Boolean);
Description 
Invoke this procedure to allow port net names be used for navigation.
See also 
IProject interface


DM_SetAllowSheetEntryNetNames method 
(IProject interface)
Syntax 
Procedure DM_SetAllowSheetEntryNetNames (AAllow : Boolean);
Description 
Invoke this procedure to allow sheet entry net names be used for navigation in Altium Designer.
See also 
IProject interface


DM_SetAppendSheetNumberToLocalNets method 
(IProject interface)
Syntax 
Procedure DM_SetAppendSheetNumberToLocalNets (AAppend : Boolean);
Description 
Invoke this procedure to have the ability to append sheet numbers to local nets on a document / project.
See also 
IProject interface


DM_SetAsCurrentProject method 
(IProject interface)
Syntax 
Procedure DM_SetAsCurrentProject;
Description 
Invoke this function to set the project as the current project in Altium Designer.
See also 
IProject interface


DM_SetDefaultConfigurationName method 
(IProject interface)
Syntax 
Procedure DM_SetDefaultConfigurationName(Configuration : WideString);
Description 
The procedure sets the name for the default configuration of a FPGA project.
See also 
IProject interface


DM_SetDefaultPcbType method 
(IProject interface)
Syntax 
Procedure DM_SetDefaultPcbType(PcbType : WideString);
Description

Example

See also 
IProject interface


DM_SetErrorLevels method 
(IProject interface)
Syntax 
Procedure DM_SetErrorLevels(AErrorKind : TErrorKind;AErrorLevel : TErrorLevel);
Description

Example

See also 
IProject interface


DM_SetHierarchyMode method 
(IProject interface)
Syntax 
Procedure DM_SetHierarchyMode (AFlatten : TFlattenMode);
Description 
Invoke this function to set which hierarchy mode for this project. It can be one of the following modes: eFlatten_Smart,eFlatten_Flat,eFlatten_Hierarchical,eFlatten_Global
See also 
IProject interface


DM_SetOutputPath method 
(IProject interface)
Syntax 
Procedure DM_SetOutputPath (AnOutputPath : WideString);
Description 
Sets the output path for generated documents to go in by the Altium Designer output generator.
See also 
IProject interface


DM_StartCrossProbing method 
(IProject interface)
Syntax 
Procedure DM_StartCrossProbing(CtrlDoesSwitch : Boolean);
Description 
This procedure invokes the cross probing function. Both source and primary implementation documents need to be open in Altium Designer in order for the cross probing to work.
See also 
IProject interface


DM_StartNavigation method 
(IProject interface)
Syntax 
Procedure DM_StartNavigation;
Description 
This procedure invokes the navigation panel for the current project. The project needs to be compiled first.
See also 
IProject interface


DM_ToDoManager method 
(IProject interface)
Syntax 
Function DM_ToDoManager : IToDoManager;
Description 
Invoke this function to have access to the IToDoManager object. This ToDo manager allows you to define to dos for your current project.
See also 
IProject interface


DM_TopLevelLogicalDocument method 
(IProject interface)
Syntax 
Function DM_TopLevelLogicalDocument : IDocument;
Description 
This function returns the top level logical document of this current project. A logical document is usually a Schematic document and can represent a document of a multi channel project for example.
See also 
IProject interface


DM_TopLevelPhysicalDocument method 
(IProject interface)
Syntax 
Function DM_TopLevelPhysicalDocument : IDocument;
Description 
This function returns the top level physical document of this current project. A physical document usually is a PCB document.
See also 
IProject interface


DM_UpdateConstraints method 
(IProject interface)
Syntax 
Function DM_UpdateConstraints : LongBool;
Description 
Invoke this function to update the constraint files used for a FPGA project and for corresponding PCB projects with FPGA components.
See also 
IProject interface


DM_UserID method 
(IProject interface)
Syntax 
Function DM_UserID : WideString;
Description 
The function returns a value that represents the UserID of the project.
See also 
IProject interface


DM_ViolationCount method 
(IProject interface)
Syntax 
Function DM_ViolationCount : Integer;
Description 
This function returns the number of violations reported by Altium Designer for this current project.
See also 
IProject interface


DM_Violations method 
(IProject interface)
Syntax 
Function DM_Violations(Index : Integer) : IViolation;
Description 
Returns the indexed violation for a current project. This is to be used in conjunction with the DM_ViolationCount method.
See also 
IProject interface


GetNavigationHistory method 
(IProject interface)
Syntax 
Function GetNavigationHistory : INavigationHistory;
Description 
This function returns the status of the navigation buttons on the Navigator panel for the current project in Altium Designer. Check out INavigationHistory interface for details.
See also 
IProject interface

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.