IDocument interface

Overview 
The IDocument interface represents the existing document in Altium Designer. A document can be a Schematic, PCB, VHDL, PCB Library document etc. 
The DM_DocumentKind method of the IDocument interface when invoked returns you the document type. A document can be part of a project or free documents project.
An existing document can be queried to return the project interface this document is associated with.
Notes 
The IDocument interface is a standalone interface.

IDocument methods 

Function DM_FullPath : WideString;
Function DM_FileName : WideString;
Function DM_DocumentIsLoaded : Boolean;
Function DM_LoadDocument : Boolean;
Function DM_DocumentKind : WideString;
Function DM_IsPrimaryImplementationDocument : Boolean;
Function DM_Project : IProject;


Function DM_IsPhysicalDocument : Boolean;
Function DM_PhysicalInstancePath : WideString;
Function DM_PhysicalInstanceName : WideString;
Function DM_PhysicalRoomName : WideString;
Function DM_PhysicalDocumentCount : Integer;


Function DM_CurrentInstanceNumber : Integer;
Function DM_ChannelIndex : Integer;
Function DM_ChannelPrefix : WideString;
Function DM_ChannelRoomNamingStyle : TChannelRoomNamingStyle;
Function DM_Ports(Index : Integer) : INetItem;
Function DM_UniqueParts(Index : Integer) : IPart;
Function DM_Parts(Index : Integer) : IPart;
Function DM_ChildDocumentCount : Integer;
Function DM_ParentDocumentCount : Integer;
Function DM_ParentSheetSymbolCount : Integer;
Function DM_PortCount : Integer;
Function DM_CrossSheetConnectorCount : Integer;
Function DM_ComponentCount : Integer;
Function DM_UniqueComponentCount : Integer;
Function DM_BusCount : Integer;
Function DM_UniquePartCount : Integer;
Function DM_PartCount : Integer;
Function DM_SheetSymbolCount : Integer;
Function DM_NetCount : Integer;
Function DM_TextFrameCount : Integer;
Function DM_RuleCount : Integer;
Function DM_ChannelClassCount : Integer;
Function DM_ComponentClassCount : Integer;
Function DM_NetClassCount : Integer;
Function DM_DifferentialPairCount : Integer;
Function DM_RoomCount : Integer;
Function DM_VHDLEntityCount : Integer;
Function DM_ConstraintGroupCount : Integer;
Function DM_ModelKind : WideString;
Function DM_IndentLevel : Integer;
Procedure DM_UpdateDateModified;
Function DM_Compile : LongBool;
Function DM_ScrapCompile(ForceCompile : Boolean) : LongBool;
Function DM_DocumentIsTextual : Boolean;
Function DM_SpatialAnalysisForTest : Integer;
Function DM_HarnessNetCount : Integer;
Function DM_HarnessConnectorCount : Integer;


Function DM_ScrapCompileWithOptions(ForceCompile : Boolean; AOptions : Wid
Function DM_GetItemRevisionGUID : WideString;
Procedure DM_SetItemRevisionGUID(S : WideString);
Function DM_BlanketCount : Integer;
Function DM_NeedsScrapCompile : Boolean;
Function DM_Parameters(Index : Integer) : IParameter;
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;
Function DM_CalculateParameterValue(AParameter : IParameter) : WideString;

 

Methods

DM_BusCount method 
(IDocument interface)
Syntax 
Function DM_BusCount : Integer;
Description 
The function returns the number of bus objects from this document. Use this in conjunction with the DM_Buses(Index) to go through each bus object.
See also 
IDocument interface

DM_Buses method

(IDocument interface)
Syntax 
Function DM_Buses (Index : Integer) : IBus;
Description 
The function returns the indexed Bus instance from this document.
See also 
IDocument interface

DM_ChannelClassCount method

(IDocument interface)
Syntax 
Function DM_ChannelClassCount : Integer;
Description 
The function denotes the number of Channel Classes from this document. Use this Channel Class count in conjunction with the DM_ChannelClasses(index) to go through each channel class.
See also 
IDocument interface

DM_ChannelClasses method

(IDocument interface)
Syntax 
Function DM_ChannelClasses (Index : Integer) : IChannelClass;
Description 
The function returns the indexed ChannelClass instance from this document. Use this in conjunction with the DM_ChannelClassCount function
See also 
IDocument interface
DM_ChannelIndex method 
(IDocument interface)
Syntax 
Function DM_ChannelIndex : Integer;
Description 
The function returns the channel index of this document. This is especially for multi-channel designs where a single source document can be referenced multiple times.
See also 
IDocument interface
DM_ChannelPrefix method 
(IDocument interface)
Syntax 
Function DM_ChannelPrefix : WideString;
Description 
The function returns the channel prefix of this document. This is especially for multi-channel designs where a single source document can be referenced multiple times.
See also 
IDocument interface
DM_ChannelRoomNamingStyle method 
(IDocument interface)
Syntax 
Function DM_ChannelRoomNamingStyle : TChannelRoomNamingStyle;
Description 
The function returns the channel room naming style value.
See also 
IDocument interface

DM_ChildDocumentCount method

(IDocument interface)
Syntax 
Function DM_ChildDocumentCount : Integer;
Description 
The function returns the number of child documents relative to this document.
See also 
IDocument interface
DM_ChildDocuments method 
(IDocument interface)
Syntax 
Function DM_ChildDocuments (Index : Integer) : IDocument;
Description 
The function returns the indexed child document. A hierarchical design consists of multi layered parent-child documents.
See also 
IDocument interface

DM_Compile method

(IDocument interface)
Syntax 
Function DM_Compile : LongBool;
Description 
The function invokes the compiler to compile this document. If the compile was successful, a true value is returned.
See also 
IDocument interface

DM_ComponentClassCount method

(IDocument interface)
Syntax 
Function DM_ComponentClassCount : Integer;
Description 
The function denotes the number of component classes from this document. Use this Component class count in conjunction with the DM_ComponentClasses(index) to go through each component class.
See also 
IDocument interface

DM_ComponentClasses method

(IDocument interface)
Syntax 
Function DM_ComponentClasses (Index : Integer) : IComponentClass;
Description 
The function returns the indexed ComponentClass instance from this document. Use this in conjuniton with the DM_ComponentClassCount function.
See also 
IDocument interface

DM_ComponentCount method

(IDocument interface)
Syntax 
Function DM_ComponentCount : Integer;
Description 
The function returns the number of component instances on this document. Use this in conjunction with the DM_Components(Index) method to go through each component object.
See also 
IDocument interface

DM_Components method

(IDocument interface)
Syntax 
Function DM_Components (Index : Integer) : IComponent;
Description 
The function returns the indexed component instance from this document. This is to be used in conjunction with the DM_ComponentCount method.
See also 
IDocument interface

DM_ConstraintGroupCount method

(IDocument interface)
Syntax 
Function DM_ConstraintGroupCount : Integer;
Description 
The function denotes the number of constraint groups.
See also 
IDocument interface

DM_ConstraintGroups method

(IDocument interface)
Syntax 
Function DM_ConstraintGroups (Index : Integer) : IConstraintGroup;
Description 
The function returns the indexed constraint group. Use the DM_ConstraintGroupCount function to get the number of constraint groups.
See also 
IDocument interface

DM_CreateViolation method

(IDocument interface)
Syntax 
Function DM_CreateViolation (AErrorKind : TErrorKind;AErrorString : WideString) : IViolation;
Description 
The function creates a violation based on the error kind and error string upon an incorrect design.
See also 
IDocument interface

DM_CrossSheetConnectorCount method

(IDocument interface)
Syntax 
Function DM_CrossSheetConnectorCount : Integer;
Description 
The function returns the number of cross sheet connectors on this document. Use this in conjunction with the DM_CrossConnectors(index) to go through each cross connector object.
See also 
IDocument interface

DM_CrossSheetConnectors method

(IDocument interface)
Syntax 
Function DM_CrossSheetConnectors (Index : Integer) : ICrossSheet;
Description 
The function returns the indexed cross sheet connector instance from this document. This is to be used in conjunction with the DM_CrossSheetConnectorCount method.
See also 
IDocument interface

DM_CurrentInstanceNumber method

(IDocument interface)
Syntax 
Function DM_CurrentInstanceNumber : Integer;
Description 
The function returns the current instance number for this document (especially for multi-channel designs where a design document can be referenced multiple times).
Example

See also 
IDocument

DM_DifferentialPairs method

(IDocument interface)
Syntax 
Function DM_DifferentialPairs(Index : Integer) : IDifferentialPair;
Description 
This function returns an indexed differential pair from a document in the project.
See also 
IDocument interface
IDifferentialPair interface

DM_DifferentialPairCount method

(IDocument interface)
Syntax 
Function DM_DifferentialPairCount : Integer;
Description 
This function returns the number of differential pairs used in a document in the project.
See also 
IDocument interface
IDifferentialPair interface
DM_DocumentIsLoaded method 
(IDocument interface)
Syntax 
Function DM_DocumentIsLoaded : Boolean;
Description 
This function returns a boolean value whether this document has been loaded in Altium Designer or not.
See also 
IDocument
DM_DocumentIsTextual method 
(IDocument interface)
Syntax 
Function DM_DocumentIsTextual : Boolean;
Description 
The function denotes whether the document is a text document.
See also 
IDocument interface

DM_DocumentKind method

(IDocument interface)
Syntax 
Function DM_DocumentKind : WideString;
Description 
This function returns the document kind for the current document. A document could be a Schematic document and thus the string returned is 'SCH'. Check the installation file of each server for the Server Name.
Example

See also 
IDocument

DM_FileName method 

(IDocument interface)
Syntax 
Function DM_FileName : WideString;
Description 
This function returns the file name string of this document.
See also 
IDocument


DM_FullPath method

 (IDocument interface)
Syntax 
Function DM_FullPath : WideString;
Description 
This function returns the full path of where this document lives.
See also 
IDocument


DM_IndentLevel method 

(IDocument interface)
Syntax 
Function DM_IndentLevel : Integer;
Description 
The function returns the indent level for this current document with respect to the current project.
See also 
IDocument interface


DM_IsPhysicalDocument method 

(IDocument interface)
Syntax 
Function DM_IsPhysicalDocument : Boolean;
Description 
This function returns a Boolean value whether this document is a physical document or not. 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.
See also 
IDocument


DM_IsPrimaryImplementationDocument method 

(IDocument interface)
Syntax 
Function DM_IsPrimaryImplementationDocument : Boolean;
Description 
This function returns a Boolean value whether this document is a primary implementation document (namely a PCB document for instance). A schematic document is a source document and is centric to a design project.
Example

See also 
IDocument


DM_LoadDocument method

 (IDocument interface)
Syntax 
Function DM_LoadDocument : Boolean;
Description 
This function returns a Boolean value whether this document has been loaded or not.
Example

See also 
IDocument


DM_LogicalDocument method 

(IDocument interface)
Syntax 
Function DM_LogicalDocument : IDocument;
Description 
This function returns the logical document if valid. Otherwise a nil value is returned. 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.
See also 
IDocument


DM_ModelKind method

 (IDocument interface)
Syntax 
Function DM_ModelKind : WideString;
Description 
The function returns the model kind string related to this document.
See also 
IDocument interface


DM_NetClassCount method 

(IDocument interface)
Syntax 
Function DM_NetClassCount : Integer;
Description 
The function denotes the number of net classes on this document. Use this NetClass count in conjunction with the DM_NetClasses(Index) method to go through each net class.
See also 
IDocument interface


DM_NetClasses method 

(IDocument interface)
Syntax 
Function DM_NetClasses (Index : Integer) : INetClass;
Description 
The function returns the indexed NetClass instance from this document. Use this in conjunction with the DM_NetClassCount function.
See also 

IDocument interface

 
DM_NetCount method 

(IDocument interface)
Syntax 
Function DM_NetCount : Integer;
Description 
The function returns the number of nets from this document. Use this Net count in conjunction with the DM_Nets(Index) to go through each sheet symbol object
See also 
IDocument interface


DM_Nets method 

(IDocument interface)
Syntax 
Function DM_Nets (Index : Integer) : INet;
Description 
The function returns an indexed net associated with this document.
See also 
IDocument interface


DM_ParentDocumentCount method 

(IDocument interface)
Syntax 
Function DM_ParentDocumentCount : Integer;
Description 
The function returns the number of parent documents relative to this document.
See also 
IDocument interface


DM_ParentDocuments method 

(IDocument interface)
Syntax 
Function DM_ParentDocuments (Index : Integer) : IDocument;
Description 
The function returns the indexed parent document. A hierarchical design consists of multi layered parent-child documents.
See also 
IDocument


DM_PartCount method 

(IDocument interface)
Syntax 
Function DM_PartCount : Integer;
Description 
The function returns the number of part objects from this document. Use this PartCount in conjunction with the DM_Parts(Index) to go through each part object.
See also 
IDocument interface


DM_Parts method 

(IDocument interface)
Syntax 
Function DM_Parts (Index : Integer) : IPart;
Description 
The function returns an indexed part associated with this document.
See also 
IDocument interface


DM_PhysicalDocumentCount method 

(IDocument interface)
Syntax 
Function DM_PhysicalDocumentCount : Integer;
Description 
The function returns the number of physical documents associated with this document.
See also 
IDocument interface


DM_PhysicalDocumentParent method 

(IDocument interface)
Syntax 
Function DM_PhysicalDocumentParent : IDocument;
Description 
The function returns the IDocument interface for a parent physical document. Could be a VHDL or a PCB document for example.
See also 
IDocument interface


DM_PhysicalInstanceName method 

(IDocument interface)
Syntax 
Function DM_PhysicalInstanceName : WideString;
Description 
The function returns the name of this physical document if valid. Otherwise an empty string is returned.
Example

See also 
IDocument


DM_PhysicalInstancePath method 

(IDocument interface)
Syntax 
Function DM_PhysicalInstancePath : WideString;
Description 
The function returns the path to the physical document instance if valid. Otherwise an empty string is returned.
See also 
IDocument interface


DM_PhysicalRoomName method 

(IDocument interface)
Syntax 
Function DM_PhysicalRoomName : WideString;
Description 
The function returns the name of the room on this physical document if valid. Otherwise a nil value is returned.
See also 
IDocument interface


DM_PortCount method 

(IDocument interface)
Syntax 
Function DM_PortCount : Integer;
Description 
The function returns the number of port objects on this document. Use this in conjunction with the DM_Ports(index) to go through each port object.
See also 
IDocument interface


DM_Ports method 

(IDocument interface)
Syntax 
Function DM_Ports (Index : Integer) : INetItem;
Description 
The function returns the indexed port instance from this document. This is to be used in conjunction with the DM_PortCount method
See also 
IDocument


DM_Project method 

(IDocument interface)
Syntax 
Function DM_Project : IProject;
Description 
This function returns the IProject object interface that this document is associated with.
See also 
IDocument


DM_RoomCount method 

(IDocument interface)
Syntax 
Function DM_RoomCount : Integer;
Description 
The function denotes the number of rooms on this document. Use this RoomCount in conjunction with the DM_Rooms(Index) to go through each room object.
See also 
IDocument interface


DM_Rooms method 

(IDocument interface)
Syntax 
Function DM_Rooms (Index : Integer) : IRoom;
Description 
The function returns the indexed room instance from this document. Use this in conjunction with the DM_RoomCount function.
See also 
IDocument interface


DM_RuleCount method 

(IDocument interface)
Syntax 
Function DM_RuleCount : Integer;
Description 
The function returns the number of rules from this document. Use this Rule count in conjunction with the DM_Rules(Index) to go through each sheet symbol object
See also 
IDocument interface


DM_Rules method 

(IDocument interface)
Syntax 
Function DM_Rules (Index : Integer) : IRule;
Description 
The function denotes the indexed rule from this document. Use this DM_RuleCount in conjunction with the DM_Rules to go through each rule found from this document..
See also 
IDocument interface


DM_ScrapCompile method

 (IDocument interface)
Syntax 
Function DM_ScrapCompile(ForceCompile : Boolean) : LongBool;
Description 
The function invokes a scrap compile (by force or not). A scrap compile is the background compile in Altium Designer on a design document and does all the auto - junctions for bus and wire objects. Also the scrap compile does the online rule checks in schematics. It is totally separate from the main compile which compile projects.
See also 
IDocument interface


DM_SheetSymbolCount method 

(IDocument interface)
Syntax 
Function DM_SheetSymbolCount : Integer;
Description 
The function returns the number of sheet symbols from this document. Use this SheetSymbol count in conjunction with the DM_SheetSymbols(Index) to go through each sheet symbol object.
See also 
IDocument interface


DM_SheetSymbols method 

(IDocument interface)
Syntax 
Function DM_SheetSymbols (Index : Integer) : ISheetSymbol;
Description 
The function returns an indexed sheet symbol associated with this document.
See also 
IDocument interface


DM_SignalManager method 

(IDocument interface)
Syntax 
Function DM_SignalManager : ISignalManager;
Description 
The function returns the signal manager interface.
See also 
IDocument interface

ISignalManager interface

 
DM_TextFrameCount method 

(IDocument interface)
Syntax 
Function DM_TextFrameCount : Integer;
Description 
The function returns the number of text frame objects from this document. Use this TextFrame count in conjunction with the DM_TextFrames(Index) to go through each sheet symbol object
See also 
IDocument interface


DM_TextFrames method 

(IDocument interface)
Syntax 
Function DM_TextFrames (Index : Integer) : ITextFrame;
Description 
The function returns an indexed textframe object associated with this document.
See also 
IDocument interface


DM_UniqueComponentCount method 

(IDocument interface)
Syntax 
Function DM_UniqueComponentCount : Integer;
Description 
The function returns the number of unique components according to the library (ies) they are placed from. A duplicate of components of the same component kind is counted as one (1). Use this in conjunction with the DM_UniqueComponents(Index) method to go through each unique component object.
See also 
IDocument


DM_UniqueComponents method 

(IDocument interface)
Syntax 
Function DM_UniqueComponents (Index : Integer) : IComponent;
Description 
The function returns the indexed unique component instance from this document. This function is to be used in conjunction with the DM_UniqueComponentCount method.
See also 
IDocument interface


DM_UniquePartCount method 

(IDocument interface)
Syntax 
Function DM_UniquePartCount : Integer;
Description 
The function denotes the number of unique parts from this document. Duplicates of the same part kind are only returned as a count of one (1).
See also 
IDocument interface


DM_UniqueParts method 

(IDocument interface)
Syntax 
Function DM_UniqueParts (Index : Integer) : IPart;
Description 
The function returns an indexed unique part associated with this document. Note, if multiple instances of the same part exist, then only one of these parts will be recognized.
See also 
IDocument


DM_UpdateDateModified method 

(IDocument interface)
Syntax 
Procedure DM_UpdateDateModified;
Description 
The procedure sets the modified date for this document.
See also 
IDocument interface


DM_VHDLEntities method 

(IDocument interface)
Syntax 
Function DM_VHDLEntities (Index : Integer) : IVHDLEntity;
Description 
The function returns the indexed VHDL entity instance from this document. Use this in conjunction with the DM_VHDLEntityCount function.
See also 
IDocument interface
DM_VHDLEntityCount function


DM_VHDLEntityCount method 

(IDocument interface)
Syntax 
Function DM_VHDLEntityCount : Integer;
Description 
The function denotes the number of VHDL entities from this document. Use this VHDL Entity count in conjunction with the DM_VHDLEntities(Index) to go through each VHDL entity.
See also 
IDocument interface
DM_VHDLEntities method

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