System API Client-Server Interfaces

Now reading version 16.1. For the latest, read: System API Client-Server Interfaces for version 22

Parent page: Technical Reference - System API

Please note that this documentation was last updated for an older version of Altium Designer. 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.

System API: Client-Server Interfaces

The System API Client-Server Interfaces Reference includes the following sections and content:

IClient Interface IServerModule Interface Document and Panel View Interfaces
The IClient shell and its Interfaces
IClient Methods
IClient Properties
IServerModule GetState and SetState Methods
IServerModule Methods
Properties
IExternalForm
IExternalFormHolder interface
IHTMLViewExternalForm interface
ISceneViewinterface
INavigationDocument
IServerView interface
IServerDocumentView Interface
IServerDocument Interface
IHighlightedDocument Interface
IServerPanelInfo Interface

 

IClient Interface

Overview

The IClient interface (from RT_ClientServerInterface unit) represents the Client subsystem of the Altium Designer application and the Client manages the commands (pre packaged process launchers), process depths and documents. The every server module loaded in Altium Designer has hooks to the single client executable subsystem, so you have access to the specific documents of any loaded servers and launch server commands.

The IClient shell and its Interfaces;

  • ICommandLauncher (deals with process launchers)
  • IProcessLauncher (deals with launching a server process)
  • IServerDocumentView (deals with panels or server documents)
  • IProcessControl (determines the level of stacked processes)
  • IGUIManager (deals with the User interface of ALtium Designer, the locations and state of panels)
  • IServerModule (deals with loaded servers in ALtium Deisgner)
  • INotification (broadcast or dispatch notification messages to servers or to a specified server)

You can obtain the IClient interface object by calling the Client function directly in your script.

IClient Methods and Properties Table

IClient methods
AddServerView
AddViewToFavorites
ApplicationIdle
BeginDisableInterface
BeginDocumentLoad
BeginRecoverySave
BroadcastNotification
CanServerStarted
CloseDocument
DispatchNotification
EndDisableInterface
EndDocumentLoad
EndRecoverySave
GetApplicationHandle
GetCommandLauncher
GetCount
GetCurrentView
GetDefaultExtensionForDocumentKind
GetDocumentByPath
GetDocumentKindFromDocumentPath
GetDynamicHelpManager
GetEncryptedTechnologySets
GetGUIManager
GetMainWindowHandle
GetNavigationSystem
GetOptionsSet
GetOptionsSetByName
GetOptionsSetCount
GetPanelInfoByName
GetProcessControl
GetRealMainWindowHandle
GetServerModule
GetServerModuleByName
GetServerNameByPLID
GetServerRecord
GetServerRecordByName
GetServerRecordCount
GetServerViewFromName
GetTimerManager
GetWindowKindByName
HideDocument
InRecoverySave
IsDocumentOpen
IsQuitting
LastActiveDocumentOfType
LicenseInfoStillValid
OpenDocument
OpenDocumentShowOrHide
QuerySystemFont
RegisterNotificationHandler
RemoveServerView
SetCurrentView
ShowDocument
ShowDocumentDontFocus
StartServer
StopServer
UnregisterNotificationHandler
IClient Properties
ApplicationHandle
CommandLauncher
Count
CurrentView
GUIManager
MainWindowHandle
NavigationSystem
ProcessControl
ServerModule
ServerModuleByName
TimerManager

IClient Methods

AddServerView method

(IClient interface)
Syntax
Procedure AddServerView (AView : IServerView);
Description
This procedure adds a document view such as a custom panel in the Client object within Altium Designer. In the TServerModule constructor, where the server commands are registered, this is the place to create global panel views. The TServerModule.CreateServerViews method will have the global panel form and the view created from this panel form. Then the view is added to the server module (TServerModule.AddView()) as well as in the client object (Client.AddServerView).
See also
IServerView interface
IClient interface
RT_ServerImplementation for the TServerModule class.

ApplicationIdle method

(IClient interface)
Syntax
Procedure ApplicationIdle;
Description
When the ApplicationIdle method is invoked, the procedure puts the Altium Designer in a mode where it has a chance to process Window and Altium Designer specific messages.
See also
IClient interface

BeginDisableInterface method

(IClient interface)
Syntax
Procedure BeginDisableInterface;
Description
These BeginDisableInterface and EndDisableInterface methods are invoked when the User Interface of Client need to be disabled, for example there might be extensive processing going on, and you do not want the user’s intervention.
See also
EndDisableInterface method
IClient interface

BeginDocumentLoad method

(IClient interface)
Syntax
Procedure BeginDocumentLoad;
Description
The BeginDocumentLoad and EndDocumentLoad procedures are used to load a group of documents in Altium Designer.
Example

Client.BeginDocumentLoad;
ServerDocument1 := Client.OpenDocument('Text',FileName1);
ServerDocument2 := Client.OpenDocument('Text',FileName2);
ServerDocument3 := Client.OpenDocument('Text',FileName3);
Client.EndDocumentLoad(True);

See also
EndDocumentLoad method
IClient interface

BeginRecoverySave method

(IClient interface)
Syntax
Procedure BeginRecoverySave;
Description
The BeginRecoverySave and EndRecoverySave properties can be used to suppress the client notification of document name changes when doing a backup of a current design document in Altium Designer. To check if the recovery save process is in progress, invoke the InRecoverySave method.
See also
EndRecoverySave method
InRecoverySave method
IClient interface

BroadcastNotification method

(IClient interface)
Syntax
Procedure BroadcastNotification (ANotification : INotification);
Description
This procedure broadcasts a notification message in Altium Designer where all active design documents / servers have an opportunity to respond. A BoardcastNotification is a DispatchNotification (Nil, ANotification); There are five types of Notification interfaces; ISystemNotification, IDocumentNotification, IDocumentFormNotification, IViewNotification and IModuleNotification.
See also
DispatchNotifiaction method
INotification interface
IClient interface

Client_CanServerStarted method

(IClient interface)
Syntax
Function CanServerStarted (AModuleName : PChar) : LongBool;
Description
This function checks if a server module can be loaded in Altium Designer. Use this before invoking the StartServer function.
See also
IClient interface
StartServer method

CloseDocument method

(IClient interface)
Syntax
Procedure CloseDocument(ADocument : IServerDocument);
Description
This procedure fetches the IServerDocument parameter to close the specified document (if it is loaded and opened in Altium Designer already). Note the document is not removed from Altium Designer, that is, the document still exists on the Projects panel for example.
See also
OpenDocument method
IClient interface

Count property

(IClient interface)
Syntax
Property Count : Integer Read GetCount;
Description
This property returns the number of active servers in a current session of Altium Designer. Use this property in conjunction with the ServerModule property to fetch Server Module interfaces.
See also
GetCount method
IServerModule interface
IClient interface

DispatchNotification method

(IClient interface)
Syntax
Procedure DispatchNotification      (AServerModule : IServerModule; ANotification : INotification);
Description
This procedure dispatches a notification message to the targeted server in Altium Designer.  There are four types of Notification interfaces; IDocumentNotification, IDocumentFormNotification, IViewNotification and IModuleNotification.
See also
INotification interface
IClient interface

EndDisableInterface method

(IClient interface)
Syntax
Procedure EndDisableInterface;
Description
These BeginDisableInterface and EndDisableInterface methods are invoked when the User Interface of Client needs to be disabled, for example there might be extensive
processing going on, and you do not want the user’s intervention. This is a Altium Designer wide method.
See also
BeginDisableInterface method
IClient interface

EndDocumentLoad method

(IClient interface)
Syntax
Procedure EndDocumentLoad(AShow : LongBool);
Description
The BeginDocumentLoad and EndDocumentLoad procedures are used to load a group of documents in Altium Designer.
Example

Client.BeginDocumentLoad;
ServerDocument1 := Client.OpenDocument('Text',FileName1);
ServerDocument2 := Client.OpenDocument('Text',FileName2);
ServerDocument3 := Client.OpenDocument('Text',FileName3);
Client.EndDocumentLoad(True);

See also
IClient interface
BeginDocumentLoad method

EndRecoverySave method

(IClient interface)
Syntax
Procedure EndRecoverySave;
Description
The BeginRecoverySave and EndRecoverySave methods can be used to suppress the client notification of document name changes when doing a backup of a current design document in Altium Designer.
To check if the recovery save is in progress, invoke the InRecoverySave method.
See also
BeginRecoverySave method
InRecoverySave method
IClient interface

GetApplicationHandle method

(IClient interface)
Syntax
Function  GetApplicationHandle : Integer;
Description
You can use the application handle into server code if dialogs need to be created dynamically from your server and so that when a dialog that appears on Altium Designer will inherit Altium Designer’s icon and appear as one whole application on the task bar.
This ApplicationHandle property can be passed as a parameter for the create constructor of the dialog. The GetMainWindowHandle function is its equivalent.
See also
GetMainWindowHandle method
ApplicationHandle property
IClient interface

GetCommandLauncher method

(IClient interface)
Syntax
Function  GetCommandLauncher   : ICommandLauncher;
Description
This function fetches the ICommandLauncher interface which represents Client’s process launcher which can be used to launch a server process and its parameters. See the IProcessLauncher interface as well.
See also
ICommandLauncher interface
IProcessLauncher interface
IClient interface

GetCount method

(IClient interface)
Syntax
Function  GetCount : Integer;
Description
This method returns the number of active (loaded) servers in a current session of Altium Designer. Use this method (or the Count property) in conjunction with the ServerModule property to fetch Server Module interfaces.
See also
Count property
IClient interface

GetCurrentView method

(IClient interface)
Syntax
Function GetCurrentView : IServerDocumentView;
Description
This function fetches the current view (ie the open document in focus in Altium Designer). See the CurrentView property and the IServerDocumentView interface.
Example

Procedure GrabACurrentDocumentView;
Var 
    ServerDocumentView : IServerDocumentView;
    CurrentDirectory   : AnsiString;
Begin
    ServerDocumentView := Client.GetCurrentView;
    CurrentDirectory := ExtractFileDir(ServerDocumentView.GetOwnerDocument.FileName);
End;

See also
CurrentView property
IClient interface

GetDefaultExtensionForDocumentKind method

(IClient interface)
Syntax
Function  GetDefaultExtensionForDocumentKind(DocumentKind : PChar) : PChar;
Description
This function returns the default extension for the specific document kind based on the document kind parameter.
IClient interface

GetDocumentByPath method

(IClient interface)
Syntax
Function  GetDocumentByPath(Const AFilePath : WideString) : IServerDocument;
Description
This function fetches the full file path to a design document and if the path is valid, an IServerDocument object interface is returned representing the whole design document and its panels.
See also
IClient interface

GetDocumentKindFromDocumentPath method

(IClient interface)
Syntax
Function GetDocumentKindFromDocumentPath   (Path : PChar) : PChar;
Description
This function returns the document kind based on the valid and full document path.
See also
IClient interface

GetEncryptedTechnologySets method

(IClient interface)
Syntax
Function GetEncryptedTechnologySets (Var ValidAtTimestamp : Cardinal) : WideString;
Description
Example
 
See also
IClient interface

GetGUIManager method

(IClient interface)
Syntax
Function  GetGUIManager : IGUIManager;
Description
Returns the GUI Manager interface. Use the GUIManager property instead. This Interface object deals with the User Interface of Altium Designer such as controlling the status bars of Altium Designer, the locations and the state of panels in Altium Designer.
See also
IGUIManager interface
IClient interface

GetLicenseManager function

(IClient interface)
Syntax
Function  GetLicenseManager : ILicenseManager;
Description
Example
 
See also
IClient interface
ILicenseManager interface

GetMainWindowHandle method

(IClient interface)
Syntax
Function  GetMainWindowHandle : Integer;
Description
You can use the application handle into server code if dialogs need to be created dynamically from your server and so that when a dialog that appears on Altium Designer will inherit Altium Designer’s icon and appear as one whole application on the task bar. This ApplicationHandle property is also its equivalent.
See also
GetApplicationHandle method
ApplicationHandle property
IClient interface

GetNavigationSystem method

(IClient interface)
Syntax
Function GetNavigationSystem : INavigationSystem;
Description
The function returns the Navigation system interface.
See also
INavigationSystem interface
IClient interface

GetOptionsManager function

(IClient interface)
Syntax
Function  GetOptionsManager : IOptionsManager;
Description
This method retrieves the IOptionsManager interface. With this interface, you can invoke the GetOptionsReader or GetOptionsWriter to retrieve or write options (settings) for the target server. Each editor server has options that manage its server documents.
Example

Var
    Reader : IOptionsReader;
Begin
    Reader := Client.OptionsManager.GetOptionsReader(NameOfServer,'');
    If Reader = Nil Then Exit;
 
    AValue := Reader.ReadBoolean(NameOfServerPreferences,SettingName,DefaultValue);
End;

See also
IClient interface
IOptionsManager

GetOptionsSetByName method

(IClient interface)
Syntax
Function GetOptionsSetByName (Const AName : Widestring) : IDocumentOptionsSet;
Description
This function retrieves the IDocumentOptionsSet interface based on the valid Name string.
See also
GetOptionsSetCount method
GetOptionsSet method
IDocumentOptionsSet interface
IClient interface

GetOptionsSetCount method

(IClient interface)
Syntax
Function  GetOptionsSetCount : Integer;
Description
This function returns you the number of Options Set.
See also
GetOptionsSet method
GetOptionsSetByName method
IClient interface

GetOptionsSet method

(IClient interface)
Syntax
Function GetOptionsSet (Index : Integer) : IDocumentOptionsSet;
Description
This function returns you the indexed Options set (IDocumentOptionsSet type).
See also
GetOptionsSetCount method
GetOptionsSetByName method
IClient interface

GetPanelInfoByName method

(IClient interface)
Syntax
Function  GetPanelInfoByName (Const APanelName  : Widestring)
: IServerPanelInfo;
Description
This function obtains the IServerPanelInfo interface for the specified panel.
See also
IServerPanelInfo interface
IClient interface

GetProcessControl method

(IClient interface)
Syntax
Function  GetProcessControl : IProcessControl;
Description
Returns the Process Control interface. This Process Control determines the number of “re-entrant” processes occurring, ie one client’s process occurring stacked on top of another active client’s process – this is the process depth. If a process control’s process depth is zero, it indicates that nothing is taking place in Altium Designer.
See also
IProcessControl interface
IClient interface

GetRealMainWindowHandle method

(IClient interface)
Syntax
Function  GetRealMainWindowHandle : THandle;
Description
The function returns the window handle of the main window in Altium Designer.
See also
IClient interface

GetServerNameByPLID method

(IClient interface)
Syntax
Function  GetServerNameByPLID(APLID : PChar) : PChar;
Description
This function returns you the server name based on the PLID identifier string (a string extracted from the server’s resources file).
See also
IClient interface

GetServerModule method

(IClient interface)
Syntax
Function  GetServerModule(Index : Integer) : IServerModule;
Description
The ServerModule property is used in conjunction with the Count property to retrieve active (loaded) servers. The ServerModule property returns the IServerModule interface for the loaded server module in Altium Designer.
Note, that PCB server and Schematic server have their own IPCB_ServerInterface and ISch_ServerInterface interfaces respectively.
IServerModule example
This example gets the Schematic's IServerModule interface and returns the number of document views open in Altium Designer

Var
    ServerModule : IServerModule;
Begin
    If Client = Nil Then Exit;
 
    ServerModule := Client.ServerModuleByName('SCH');
    ShowMessage('Doc Count = ' + IntToStr(ServerModule.DocumentCount));
End;

See also
Count property
IServerModule property
ServerModuleByName property
IClient interface

GetServerModuleByName method

(IClient interface)
Syntax
Function  GetServerModuleByName (Const AModuleName : Widestring) : IServerModule;
Description
The function returns the server module interface depending on the validity of the AModuleName parameter. Examples include ‘PCB’ or ‘SCH’. Use the ServerModuleByName property instead to return the indexed server module.
Example

Var
    ServerModule : IServerModule;
Begin
    If Client = Nil Then Exit;
 
    ServerModule := Client.ServerModuleByName('SCH');
    ShowMessage('Doc Count = ' + IntToStr(ServerModule.DocumentCount));
End;

See also
GetServerModule method
ServerModule property
IClient interface

GetServerRecord method

(IClient interface)
Syntax
Function  GetServerRecord (Index : Integer) : IServerRecord;
Description
The GetServerRecord function reports the number of installed servers based on the installation *.INS files in the System folder of Altium Designer installation). Use this in conjunction with the GetServerRecordCount function.
The IClient interface has GetServerRecord and GetServerModule methods. The difference between these two methods is that the GetServerRecord function reports the number of installed servers (*.INS files in the \System\ folder of Altium Designer installation).
The GetServerModule merely returns the active (loaded) server in Altium Designer and to get each active server, you need to invoke the GetCount function and pass the count parameter into the GetServerModule function.
See also
GetServerRecordCount method
GetServerModule method
IClient interface

GetServerRecordCount method

(IClient interface)
Syntax
Function  GetServerRecordCount : Integer;
Description
This function returns the number of server records that represent the server installation files found in the \System\ folder of the Altium Designer software installation. This is to be used in conjunction with the GetServerRecord function.
See also
IServerRecord interface
IClient interface

GetServerRecordByName method

(IClient interface)
Syntax
Function  GetServerRecordByName(AModuleName : WideString) : IServerRecord;
Description
This function returns the IServerRecord interface based on the AModuleName parameter. This IServerRecord interface represents the installation file for the server (with an INS extension).
Example

Var
    ClientModule : IClient;
    ServerRecord : IServerRecord;
    Version      : WideString;
Begin
    ClientModule := Client;
    If ClientModule = Nil Then Exit;
 
    //The IServerRecord interface encapsulates the details
    // of a server's installation file
 
    //We are interested in the Altium Designer's Client Module
    // and fetch the product version.
    ServerRecord := ClientModule.GetServerRecordByName('CLIENT');
    Version := ServerRecord.GetVersion;
 
    ShowMessage(Version);
End;

See also
IServerRecord interface
IClient interface

GetServerViewFromName method

(IClient interface)
Syntax
Function  GetServerViewFromName (Const ViewName : Widestring) : IServerView;
Description
This function returns the server view object interface depending on the name of the server view. A IServerView interface represents a panel view as well as an ancestor for a document view.
See also
IExternalForm interface
IServerView interface
IClient interface

GetTimerManager Interface

(IClient interface)
Syntax
Function  GetTimerManager : ITimerManager;
Description
This function returns the timer manager interface associated with the client sub system.
See also
ITimerManager interface
IClient interface

GetWindowKindByName method

(IClient interface)
Syntax
Function  GetWindowKindByName  (AWindowKindName : Widestring : IServerWindowKind
Description
This function returns the IServerWindowKind interface based on the AWindowKindName parameter which denotes the document kind. For example, there are two document kinds in the PCB editor – PCB and PCBLIB documents.
See also
IServerWindowKind interface
IClient interface

HideDocument method

(IClient interface)
Syntax
Procedure HideDocument (Const ADocument        : IServerDocument);
Description
This procedure hides the document, ie puts it out of focus but not closed or destroyed.
See also
CloseDocument method
OpenDocument method
ShowDocument method
IServerDocument interface
IClient interface

OpenDocumentShowOrHide method

(IClient interface)
Syntax
Function  OpenDocumentShowOrHide              (Const AKind, AFileName : WideString; AShowInTree : Boolean) : IServerDocument;
Description
This function opens a specific document but you can control how it is displayed in the Altium Designer workspace.
See also
IClient interface

HandleException method

(IClient interface)
Syntax
Procedure HandleException (Const AMessage   : WideString);
Description
Example
 
See also
IClient interface

InRecoverySave method

(IClient interface)
Syntax
Function  InRecoverySave : LongBool
Description
This function checks whether Altium Designer is in the process of Recovery Save mode, before you can invoke the BeginRecoverySave or EndRecoverySave methods.
See also
BeginRecoverySave method
EndRecoverySave method
IClient interface

IsDocumentOpen method

(IClient interface)
Syntax
Function  IsDocumentOpen (Const AFilePath : PChar) : LongBool;
Description
Returns a boolean value whether the document is open in Altium Designer or not and is dependent on whether the AFilePath parameter is valid or not.
See also
IClient interface

IsQuitting method

(IClient interface)
Syntax
Function  IsQuitting : Boolean;
Description
Returns a boolean value that represents the state Altium Designer is in: True if Altium Designer is about to quit or in the process of quitting, False if Altium Designer is still active.
See also
IClient interface

LastActiveDocumentOfType method

(IClient interface)
Syntax
Function  LastActiveDocumentOfType (Const AType : Widestring) : IServerDocument;
Description
This function returns the last active loaded document in Altium Designer by the document type. Types include PCB, SCH, TEXT, WAVE, PCBLIB, SCHLIB.
See also
IClient interface

IsInitialized function

(IClient interface)
Syntax
Function  IsInitialized : LongBool;
Description
Example
 
See also
Client interface

LicenseInfoStillValid method

(IClient interface)
Syntax
Function  LicenseInfoStillValid (Const RetrievedAt : Cardinal) : LongBool;
Description
See also
IClient interface

MainWindowHandle property

(IClient interface)
Syntax
Property MainWindowHandle : Integer Read GetMainWindowHandle;
Description
The MainWindowHandle property returns the handle of the main window in Altium Designer which can be used for addon dialogs that will be attached to Altium Designer and have a single Altium Designer icon on the Taskbar for example.
See also
GetMainWindowHandle method
ApplicationHandle property
IClient interface

OpenDocument method

(IClient interface)
Syntax
Function OpenDocument (Const AKind, AFileName : PChar) : IServerDocument;
Description
The OpenDocument method returns the IServerDocument interface depending on the DocumentKind and FileName values of this document are valid.
Example

Var
    ReportDocument : IServerDocument;
Begin
    ReportDocument  := Client.OpenDocument('Text',FileName);
    If ReportDocument <> Nil Then
        Client.ShowDocument(ReportDocument);
End

See also
ShowDocument method
IClient interface

OpenNewDocument method

(IClient interface)
Syntax
Function OpenNewDocument (Const AKind, AFileName, ANewName : Widestring; ReuseExisting : Boolean) : IServerDocument;
Description
Example
 
See also
IClient interface

QuerySystemFont method

(IClient interface)
Syntax
Procedure QuerySystemFont (    QueryMode    : TFontQueryMode;
                           Var AUseSysFont  : Boolean;
                           Var AFontName    : WideString;
                           Var AFontSize    : Integer;
                           Var AFontStyle   : TFontStyles;
                           Var AFontColor   : TColor;
                           Var AFontCharset : TFontCharset);
Description
Query the system font used.
See also
IClient interface

RegisterNotificationHandler method

(IClient interface)
Syntax
Procedure RegisterNotificationHandler(Const Handler : INotificationHandler);
Description
The RegisterNotificationHandler method registers the notification handler in the Client module part of Altium Designer once the server object is created and loaded in computer memory. The Handler parameter contains the server module object.
Notes
The INotificationHandler object interface is responsible for handling notifications raised in Altium Designer.
Each server object has a HandleNotification procedure to handle notifications when the options values have been adjusted from the system wide Preferences dialog.
The HandleNotification procedure would involve calls to update the server preferences values on the server panel for example every-time a specific server notification code is intercepted.
This method is normally used for in developing servers and not for scripts.
See also
BroadcastNotification method
DispatchNotification method
UnRegisterNotificationHandler method
INotificationHandler interface
IClient interface

RemoveServerView method

(IClient interface)
Syntax
Procedure RemoveServerView (Const AView : IServerView);
Description
This procedure removes a server view (representing a server document window) from Altium Designer.
See also
GetCurrentView method
IClient interface

ShowDocumentDontFocus method

(IClient interface)
Syntax
Procedure ShowDocumentDontFocus(ADocument : IServerDocument);
Description
This procedure fetches the IServerDocument parameter and then displays this design document but leaves the previously focussed document in focus. If there are not design documents open already, then this design document will still be displayed but not focussed.
See also
OpenDocument method
ShowDocument method
IServerDocument interface
IClient interface

ShowDocument method

(IClient interface)
Syntax
Procedure ShowDocument (ADocument : IServerDocument);
Description
This procedure fetches the IServerDocument parameter which represents the Server Document loaded in Altium Designer and then displays the design document in Altium Designer.
IServerDocument example
This example gets the client interface and then opens and shows a document.

Procedure OpenAndShowADocument(Filename : TDynamicString);
Var
    ReportDocument : IServerDocument;
Begin
    If Client = Nil Then Exit;
    ReportDocument  := Client.OpenDocument('Text',FileName);
    If ReportDocument <> Nil Then
          Client.ShowDocument(ReportDocument);
End;

See also
OpenDocument method
IServerDocument interface
IClient interface

SetCurrentView method

(IClient interface)
Syntax
Procedure SetCurrentView(Value : IServerDocumentView);
Description
This procedure fetches the IServerDocumentView parameter to set this document form as the current view in Altium Designer.
See also
GetCurrentView method
CurrentView property
IClient interface

StopServer method

(IClient interface)
Syntax
Function  StopServer (AModuleName : WideString) : Boolean;
Description
The StartServer and StopServer properties can be used to load a server in Altium Designer if it has not loaded already, before you can invoke this server’s processes and to stop this server once you have done with these server processes. This can be used to conserve computer’s memory.
The StartServer function is usually used if you need to load a design document and execute the server’s processes or its API functions if the server has not been loaded yet. Example, during a blank session of Altium Designer where there are no PCB documents open, and you need to use the PCB API to manipulate the contents on a PCB document, you would need to “start” the PCB server first so the PCB API is made active.
Example of the StopServer method
Client.StopServer('PCB');
See also
StartServer method
IClient interface

StartServer method

(IClient interface)
Syntax
Function  StartServer (AModuleName : WideString) : Boolean;
Description
The StartServer and StopServer properties can be used to load a server in Altium Designer if it has not already, before you can invoke this server’s processes and to stop this server once you have done with these server processes. This can be used to conserve computer’s memory.
The StartServer function is usually used if you need to load a design document and execute the server’s processes or its API functions if the server has not been loaded yet. Example, during a blank session of Altium Designer where there are no PCB documents open, and you need to use the PCB API to manipulate the contents on a PCB document, you would need to “start” the PCB server first so the PCB API is made active.
Example of the StartServer method
Client.StartServer('PCB');
See also
StopServer method
IClient interface

UnregisterNotificationHandler method

(IClient interface)
Syntax
Procedure UnregisterNotificationHandler(Const Handler : INotificationHandler);
Description
The UnregisterNotificationHandler method un registers the notification handler from Client once the server object goes out of scope (destroyed). The Handler parameter contains the server module object.
Notes
The INotificationHandler object interface is responsible for handling notifications raised in Altium Designer.
Each server object has a HandleNotification procedure to handle notifications when the options values have been adjusted from the system wide Preferences dialog.
The HandleNotification procedure would involve calls to update the server preferences values on the server panel for example every-time a specific server notification code is intercepted.
This method is normally used for in developing servers and not for scripts.
See also
BroadcastNotification
DispatchNotification
RegisterNotificationHandler method
INotificationHandler interface
IClient interface

AddViewToFavorites method

(IClient interface)
Syntax
Function  AddViewToFavorites(Const AView : IServerDocumentView; AIsSnippet : Boolean) : Boolean;
Description
Example
 
See also
IClient interface

GetDynamicHelpManager method

(IClient interface)
Syntax
Function GetDynamicHelpManager : IDynamicHelpManager;
Description
The method returns the Dynamic Help manager which represents the Knowledge Center panel in Altium Designer.
See also
IClient interface
IDynamicHelpManager interface.

IClient Properties

ApplicationHandle property

(IClient interface)
Syntax
Property ApplicationHandle : Integer
Description
The ApplicationHandle property sets the application handle in a server if dialogs need to be created dynamically from your server and every time a dialog that appears in front of Altium Designer will inherit Altium Designer’s icon and appear as one whole application on the task bar.
This ApplicationHandle property can be passed as a parameter for the create constructor of a dynamic dialog for example.
Note
Normally script writers will not need to worry about this applicationhandle property. This property is used by the server writers as part of the Altium Designer SDK.
Server Example

In the server project's main unit
Function ServerFactory (AClient : IClient) : IServerModule; Safecall;
Begin
    Result := TAddOn.Create(AClient, 'AddOn');
    Application.Handle := Client.ApplicationHandle;
End;
 
In the server project's commands unit
Procedure DisplayResultsOnDialog(PadCount : TDynamicString);
Var
    DisplayForm : TDialog;
Begin
    DisplayForm := TDialog.Create(Application);
    DisplayForm.Label1.Caption := PadCount;
    DisplayForm.ShowModal;
    DisplayForm.Free;
End;

See also
IClient interface

CommandLauncher property

(IClient interface)
Syntax
Property CommandLauncher : ICommandLauncher Read GetCommandLauncher;
Description
The CommandLauncher property returns the Command Launcher interface. This interface contains the table of client’s process launchers that can be used to launch a command.
Example

If StringsEqual(ServerModule.ModuleName,'TextEdit') Then
Begin
    Client.CommandLauncher.LaunchCommand(
    'TextEdit:MoveCursorToTopOfDocument',
     Nil,0,ServerDocument.View[0]);
End;

GetCommandLauncher example

ACommandLauncher := Client.GetCommandLauncher;
If ACommandLauncher <> Nil Then
Begin
    ACommandLauncher.GetCommandState(Command,
                                     Parameters,
                                     View,
                                     Enabled,
                                     Checked,
                                     Visible,
                                     Caption,
                                     Image);
End;

See also
GetCommandLauncher method
IProcessLauncher interface
ICommandLauncher interface
IClient interface

CurrentView property

(IClient interface)
Syntax
Property  CurrentView : IServerDocumentView Read GetCurrentView Write SetCurrentView;
Description
This property returns the current document view interface which represents the current design document view in Altium Designer.
SendMessage Example
    Client.SendMessage('PCB:Zoom', 'Action=Redraw' , 255, Client.CurrentView);
CurrentView example

Procedure GrabACurrentDocumentView;
Var 
    ServerDocumentView : IServerDocumentView;
    FileName   : WideString;
Begin
    ServerDocumentView := Client.CurrentView;
    FileName := ServerDocumentView.GetOwnerDocument.FileName;
End;

ViewName example
If StrPas(Client.CurrentView.ViewName) <> UpperCase('PCBLib') Then Exit;
This code snippet uses the Client.CurrentView.ViewName method to find out the current document’s type. 
See also
GetCurrentView method
SetCurrentView method
IServerDocumentView interface
IClient interface

GUIManager Property

(IClient interface)
Syntax
Property GUIManager : IGUIManager Read GetGUIManager;
Description
The GUIManager property returns the GUIManager interface. This Interface object deals with the Altium Designer's Graphical User Interface such as controlling the status bars, the locations and the state of panels.
See also
IGUIManager interface
IClient interface

NavigationSystem property

(IClient interface)
Syntax
Property  NavigationSystem : INavigationSystem   Read GetNavigationSystem;
Description
The NavigationSystem property represents the Navigation system in Altium Designer. The navigation system is the workhouse for the Navigation panel which is the center-piece for net connectivity for the design project. There are three ways a design can be arranged - as a list of compiled sheets, flattened hierarchy and as a structural tree.
Example
 
See also
IClient interface
INavigationSystem interface

ProcessControl property

(IClient interface)
Syntax
Property ProcessControl : IProcessControl Read GetProcessControl;
Description
This property returns the IProcessControl interface. This Process Control interface determines the number of “re-entrant” processes occurring, ie one client’s process occurring stacked on top of another active client’s process – this is the process depth. If a process control’s process depth is zero, it indicates that nothing is taking place in Altium Designer. Refer to the IProcessControl interface for details.
ProcessDepth Example
ShowMessage('Current process depth ',IntToStr(Client.ProcessControl.ProcessDepth));
See also
IClient interface
IProcessControl interface

ServerModule property

(IClient interface)
Syntax
Property ServerModule [Index : Integer] : IServerModule Read GetServerModule;
Description
The ServerModule property is used in conjunction with the Count property to retrieve active (loaded) servers. The ServerModule property returns the IServerModule interface for the loaded server module in Altium Designer.
Note, that PCB server and Schematic server have their own IPCB_ServerInterface and ISch_ServerInterface interfaces respectively.
IServerModule example
This example gets the Schematic's IServerModule interface and returns the number of document views open in Altium Designer

Var
    ServerModule : IServerModule;
Begin
    If Client = Nil Then Exit;
 
    ServerModule := Client.ServerModuleByName('SCH');
    ShowMessage('Doc Count = ' + IntToStr(ServerModule.DocumentCount));
End;

See also
IClient interface
Count property
GetServerModule method
IServerModule interface

ServerModuleByName property

(IClient interface)
Syntax
Property ServerModuleByName[Const AModuleName : Widestring] : IServerModule Read GetServerModuleByName;
Description
The ServerModuleByName property returns the IServerModule interface if the module name is found in the Client’s table of active servers. For a PCB editor, module name is PCB, for a Schematic Editor, the module name is SCH etc.
Server Names
Example

Var
    ServerModule : IServerModule;
Begin
    If Client = Nil Then Exit;
 
    ServerModule := Client.ServerModuleByName('SCH');
    ShowMessage('Doc Count = ' + IntToStr(ServerModule.DocumentCount));
End;

See also
IClient interface
IServerModule interface

TimerManager property

(IClient interface)
Syntax
Property TimerManager : ITimerManager Read GetTimerManager;
Description
This property returns the timer manager object interface.
See also
IClient interface
ITimerManager interface

OptionsManager property

(IClient interface)
Syntax
Property OptionsManager : IOptionsManager Read GetOptionsManager;
Description
This is a read only property that returns the IOptionsManager interface. This interface is responsible for managing (reading and writing) values to/from the system wide Preferences dialog in Altium Designer for the specified server.
This interface is useful for server writers who wish to add their options pages in the system wide preferences dialog and manage the controls on these options pages.
Example

Var
    Reader : IOptionsReader;
Begin
    Reader := Client.OptionsManager.GetOptionsReader(NameOfServer,'');
    If Reader = Nil Then Exit;
 
    AValue := Reader.ReadBoolean(NameOfServerPreferences,SettingName,DefaultValue);
End;

See also
IClient interface
IOptionsManager interface

 

IServerModule Interface

Overview
A server deals with its own server documents. There can be different design document types, for example the Schematic Editor has two Schematic and Schematic Library document types.

Each design document, in turn stores views which can be a document window or a panel window. A server has the ability to host multiple panel views for a single document view, see the diagram below.

A server also has the ability to host multiple global panel views that represent some system state and are not necessarily tied to a particular design document (for example the Work-Space Manager server has Message, Differences and Errors panels). This document view / multiple panel views structure is the foundation of Altium Designer client / server architecture.

These IServerModule interfaces (from the RT_ClientServerInterface unit) represent loaded servers in Altium Designer. This application manages single instances of different server modules. Each server can have multiple server document kinds, for example the PCB server supports two server document kinds – PCB and PCBLIB design documents. A loaded server in Altium Designer typically hosts documents and each document in turn hosts a document view and panel views.

The diagram below represents a server module with server documents. Each document has views - the document view and the associated panel view.

Notes
An IServerModule interface has the following interfaces:

  • ICommandLauncher deals with a server’s processes table
  • IServerDocument represents a loaded design document in Altium Designer
  • IServerView represents a panel that can have a view of the Altium Designer system
  • IServerDocumentView (deals with a document view (either the document window or panel window)
  • IExternalForm represents a Altium Designer aware Delphi form either as a document form or a panel form. These forms are wrapped by the IServerDocumentView or IServerView interface object. This IExternalForm interface object has low level methods such as resizing and displaying the form and is the ancestor interface for IServerDocumentView and IServerView interfaces.
  • IProcessControl represents the level of stacked processes for this focussed server document
  • INotification receives system notifications from the Client system and all server modules receive these notifications. There is an ability to handle a notification and take it from there. Documents and associated panels can be synchronized through the use of notifications as well.

Notes
The PCB server module also has its IPCB_ServerInterface interface.
The Schematic Server module also has its ISCH_ServerInterface interface.
However both servers also have this IServerModule interface.

IServerModule Methods and Properties Table

IServerModule methods
ApplicationIdle
ReceiveNotification
CreateDocument
DestroyDocument
CreateOptionsView
CreateServerView
CreateServerDocView
RemoveServerView
AddServerView
CreateDocumentShowOrHide
IServerModule Properties
Client
CommandLauncher
Handle
ModuleName
ProcessControl
DocumentCount
Documents
ViewCount
Views

See also
IPCB_ServerInterface interface
ISCH_ServerInterface interface

IServerModule GetState and SetState Methods

GetClient method

(IServerModule interface)
Syntax
Function GetClient : IClient;
Description
The GetClient method returns the IClient interface of the client subsystem of Altium Designer. This IClient interface can be used to invoke its methods.
The GetClient method is used for the Client property.
Example
See also
IServerModule interface

GetCommandLauncher method

(IServerModule interface)
Syntax
Function GetCommandLauncher : ICommandLauncher;
Description
The CommandLauncher function returns the ICommandLauncher interface. It is used to launch a process from its server module. The CommandLauncher object contains a command table which binds a process name to the actual function that implements the process at run-time.
Whenever a process is called within the server this table is looked up in order to find the actual function pointer. If a process name is not found within this table then nothing will happen.
This CommandLauncher object is initialized in the main.pas unit of a server project. See the ICommandLauncher interface for more details.
This method is used for the CommandLauncher property.
Example
See also
IServerModule interface

GetDocumentCount method

(IServerModule interface)
Syntax
Function GetDocumentCount : Integer;
Description
The DocumentCount method returns you the number of Document Kinds. An important note is that a View is the actual design document. A Document type is a container that stores specific Views.
This method is used for the DocumentCount property.
Example
See also
IServerModule interface

GetDocuments method

(IServerModule interface)
Syntax
Function GetDocuments (Index : Integer) : IServerDocument;
Description
An editor type of server can have different document types, such as Schematic Editor and PCB Editor - these editor servers have two document types - SCH/SCHLIB and PCB/PCBLIB respectively.
An add-on type of server will normally have no document containers, because they work with an editor server acting like a piggy back and utilising the editor server's API services.
This method returns you the indexed document container which is represented by the IServerDocument interface.
This method is used for the Documents property.
Example
See also
IServerModule interface
IServerDocument interface

GetHandle method

(IServerModule interface)
Syntax
Function GetHandle : THandle;
Description
The method returns the handle of the server.
This method is used for the Handle property.
Example
See also
IServerModule interface

GetModuleName method

(IServerModule interface)
Syntax
Function GetModuleName : Widestring;
Description
The method returns the module name of this server.
For example the texteditor server’s module name is TextEdit. This server name property is defined in the associated server installation file (with an INS file extension).
This method is used for the ModuleName property.
Example
See also
IServerModule interface

GetProcessControl method

(IServerModule interface)
Syntax
Function GetProcessControl : IProcessControl;
Description
The method returns the IProcessControl interface. This interface controls the process depth for each design document in Altium Designer.
Every time a process is launched on a document, the process depth is increased by one and once this same process has finished executing, the process depth is decreased by one. When the process depth is zero, it denotes that nothing is taking place on the current design document.
This read only property is supported by the GetProcessControl method.
Example
See also
IServerModule interface

GetViewCount method

(IServerModule interface)
Syntax
Function GetViewCount : Integer;
Description
The ViewCount method returns you the number of views for the specified server.
A View object encapsulates a form/window object in Altium Designer normally as a global panel supported by its associated server.
This method is used for the ViewCount property.
Example
See also
IServerModule interface

GetViews method

(IServerModule interface)
Syntax
Function GetViews (Index : Integer) : IServerView;
Description
The GetViews method in conjunction with the GetViewCount method returns you the indexed View object. A view is a form supported by its associated server.
This method is used for the Views property.
Example
See also
IServerModule interface

IServerModule Methods

AddServerView method

(IServerModule interface)
Syntax
Procedure AddServerView (Const AView : IServerView);
Description
This procedure adds a panel in the Server Module where this new panel can be used by the module.
Invoke this function after you have created a IServerView object with the CreateServerView function or pass in the IServerView interface parameter.
Example
See also
IServerModule interface
IServerView interface

ApplicationIdle method

(IServerModule interface)
Syntax
Procedure ApplicationIdle;
Description
The ApplicationIdle procedure is an internal procedure that gets invoked when Altium Designer is idling. The ApplicationIdle procedure in all active running servers gets invoked. The messages sent by Altium Designer get the chance to be followed up.
Example
See also
IServerModule interface

CreateDocument method

(IServerModule interface)
Syntax
Function CreateDocument (Const AKind, AFileName : Widestring) : IServerDocument;
Description
The CreateDocument function creates a document supported by the server based on the AKind and AFilename parameters.
The AKind parameter represents the document kind that the server supports and the AFileName parameter is assigned to the new document.
Example
See also
IServerModule interface

CreateServerDocView method

(IServerModule interface)
Syntax
Function CreateServerDocView (Const AName : Widestring; Const ADocument : IServerDocument): IServerDocumentView;
Description
The CreateServerDocView function creates an IServerDocumentView (which could be the document or its associated panel view) object based on the Name of the document view and the IServerDocument container.
Example
See also
IServerModule interface

CreateServerView method

(IServerModule interface)
Syntax
Function CreateServerView (Const AName : Widestring) : IServerView;
Description
The CreateServerView function creates a IServerView object representing a system panel. You need to invoke the AddServerView procedure to add the object within Altium Designer.
Example
See also
IServerModule interface

CreateOptionsView method

(IServerModule interface)
Syntax
Function CreateOptionsView (Const AName : Widestring) : IDocumentOptionsView;
Description
The CreateOptionsView creates a IDocumentOptions view to be used in the system wide Preferences dialog in Altium Designer.
Example
See also
IServerModule interface

DestroyDocument method

(IServerModule interface)
Syntax
Procedure DestroyDocument (Const ADocument : IServerDocument);
Description
The DestroyDocument procedure closes and removes the design document as specified by the ADocument parameter.
Example
See also
IServerModule interface

ReceiveNotification method

(IServerModule interface)
Syntax
Procedure ReceiveNotification (Const ANotification : INotification);
Description
The ReceiveNotification procedure of the server module intercepts notifications broadcasted by Altium Designer.
The system has a BroadCastNotification or a DispatchNotification function which all running servers in Altium Designer can receive and process accordingly.
This procedure needs to be overridden and implemented.
Example
See also
IServerModule interface

RemoveServerView method

(IServerModule interface)
Syntax
Procedure RemoveServerView (Const AView : IServerView);
Description
The RemoveServerView procedure removes a IServerView object in Altium Designer which represents a system panel.
Example
See also
IServerModule interface

CreateDocumentShowOrHide method

(IServerModule interface)
Syntax
Function  CreateDocumentShowOrHide(Const AKind, AFileName : Widestring;
            AShowInTree : Boolean) : IServerDocument;
Description
The CreateDocumentShowOrHide function controls how a document when created is displayed in Altium Designer.
Example
See also
IServerModule interface

Properties

Client property

(IServerModule interface)
Syntax
Property Client : IClient Read GetClient;
Description
The Client property returns the IClient interface of the client subsystem of Altium Designer. This IClient interface can be used to invoke its methods.
This readonly property is supported by the GetClient method.
Example
See also
IServerModule interface

CommandLauncher property

(IServerModule interface)
Syntax
Property CommandLauncher : ICommandLauncher Read GetCommandLauncher;
Description
The CommandLauncher property returns the pointer to the ICommandLauncher interface. It is used to launch a process from its server module. The CommandLauncher object contains a command table which binds a process name to the actual function that implements the process at run-time.
Whenever a process is called within the server this table is looked up in order to find the actual function pointer. If a process name is not found within this table nothing will happen.
This CommandLauncher object is initialized in the main.pas unit of a server project. See the ICommandLauncher interface for more details.
This read-only property is supported by the GetCommandLauncher method.
Example
See also
IServerModule interface

DocumentCount property

(IServerModule interface)
Syntax
Property DocumentCount : Integer Read GetDocumentCount;
Description
The DocumentCount property returns you the number of Document Kinds. An important note is that a View is the actual design document. A Document type is a container that stores specific Views.
This property is supported by the GetDocumentCount method.
Example
See also
IServerModule interface

Documents property

(IDocuments interface)
Syntax
Property  Documents[Index : Integer] : IServerDocument  Read GetDocuments;
Description
An editor type of server can have different document types, such as Schematic Editor and PCB Editor - these editor servers have two document types - SCH/SCHLIB and PCB/PCBLIB respectively.
An add-on type of server will normally have no document containers, because they work with an editor server acting like a piggy back and utilising the editor server's API services.
This property returns you the indexed document container which is represented by the IServerDocument interface.
This read only property is supported by the GetDocuments method.
Example
 
See also
IClient interface
IServerModule interface
DocumentCount property

Handle property

(IServerModule interface)
Syntax
Property Handle : THandle Read GetHandle;
Description
The Handle property returns the handle of the server. This read only property is supported by the GetHandle method.
Example
See also
IServerModule interface

ModuleName property

(IServerModule interface)
Syntax
Property ModuleName : Widestring Read GetModuleName;
Description
The ModuleName property returns the module name of this server.
For example the Texteditor server’s module name is TextEdit. This server name property is defined in the associated server installation file (with an INS file extension).
This read only property is supported by the GetModuleName method.
Example

If StringsEqual(ServerModule.ModuleName,'TextEdit') Then
Begin
...
End;

See also
IServerModule interface

ProcessControl property

(IServerModule interface)
Syntax
Property ProcessControl : IProcessControl Read GetProcessControl;
Description
The ProcessControl property returns the pointer to the IProcessControl interface. This interface controls the process depth for each design document in Altium Designer.
Every time a process is launched on a document, the process depth is increased by one and once this same process has finished executing, the process depth is decreased by one. When the process depth is zero, it denotes that nothing is taking place on the current design document.
This read only property is supported by the GetProcessControl method.
Example
See also
IServerModule interface

ViewCount property

(IServerModule interface)
Syntax
Property ViewCount : Integer Read GetViewCount;
Description
The ViewCount property returns you the number of views for the specified server.
A View object encapsulates a form/window object in Altium Designer normally as a global panel supported by its associated server.
This read only property is supported by the GetViewCount method.
Example
See also
IServerModule interface

Views property

(IServerModule interface)
Syntax
Property  Views[Index : Integer] : IServerView Read GetViews;
Description
The Views property in conjunction with the ViewCount property returns you the indexed View object. A view is a form supported by its associated server.
This read only property is supported by the GetViews method.
Example
 
See also
IClient interface
IServerModule interface

 

Document and Panel View Interfaces

IExternalForm

Overview
The IExternalForm interface represents a Delphi form either as a document form or a panel form.  This IExternalForm interface object has low level methods such as resizing and displaying the form.

Notes
The Altium Designer platform is based on the object interfaces technology by Borland(TM), thererfore TForm, TFrame, and other VCL controls to object interfaces are not passed into object interfaces that can be exposed to third party development in different programming systems. For example VCL technology is not compatible with MS C++ toolkit.

Therefore to work with windows in the Altium Designer platform, you use the IExternalForm interface to have access to windows and manipulate them. The IExternalFormHolder interface and the TExternalFormComponent class are used to work with Delphi windows in a server plugged into the Altium Designer platform and accessible to other servers plugged in.

IExternalForm Methods and Properties Table

IExternalForm methods
SetParentWindow
ParentWindowCreated
ParentWindowDestroyed
GetBounds
Hide
SetBounds
SetFocus
Show
FocusFirstTabStop
IExternalForm properties
Caption
Handle

See also
IServerView interface
IServerDocumentView interface
IExternalFormHolder interface
TExternalFormComponent class from ExternalForm unit
TServerExternalFormComponent class from ExternalForm unit.

IExternalForm Methods

FocusFirstTabStop method

(IExternalForm interface)
Syntax
Procedure FocusFirstTabStop;
Description
Example
 
See also
IClient interface
IExternalForm interface

GetBounds method

(IExternalForm interface)
Syntax
Procedure GetBounds (Var ALeft, ATop, AWidth, AHeight : Integer);
Description
This procedure retrieves the four bounds (left, top, width and height) of the form.
Example
 
See also
IClient interface
IExternalForm interface

Hide method

(IExternalForm interface)
Syntax
Procedure Hide;
Description
This Hide method hides the form from view in Altium Designer.
Example
 
See also
IClient interface
IExternalForm interface

ParentWindowCreated method

(IExternalForm interface)
Syntax
Procedure ParentWindowCreated;
Description
Example
 
See also
IClient interface
IExternalForm interface

ParentWindowDestroyed method

(IExternalForm interface)
Syntax
Procedure ParentWindowDestroyed;
Description
Example
 
See also
IClient interface
IExternalForm interface

SetBounds method

(IExternalForm interface)
Syntax
Procedure SetBounds (ALeft, ATop, AWidth, AHeight : Integer);
Description
This procedure sets the bounds of the external form.
Example
 
See also
IClient interface
IExternalForm interface

SetFocus method

(IExternalForm interface)
Syntax
Procedure SetFocus;
Description
This procedure sets the Delphi based form in focus in Altium Designer.
Example
 
See also
IClient interface
IExternalForm interface

SetParentWindow method

(IExternalForm interface)
Syntax
Procedure SetParentWindow (Const ParentWindow : IExternalFormHolder);
Description
Example
 
See also
IClient interface
IExternalForm interface

Show method

(IExternalForm interface)
Syntax
Procedure Show;
Description
This procedure displays the hidden form.
Example
 
See also
IClient interface
IExternalForm interface

IExternalForm Properties
Caption property

(IExternalForm interface)
Syntax
Property  Caption : Widestring
Description
A read only property that returns you the caption of the external form that the dialog is associated with.
Example
 
See also
IClient interface
IExternalForm interface

Handle property

(IExternalForm interface)
Syntax
Property Handle : HWND
Description
A read only property that returns the handle of the Delphi based form.
Example
 
See also
IClient interface
IExternalForm interface

IExternalFormHolder interface

Overview
The IExternalFormHolder interface represents the TExternalFormComponent object and holds the IExternalForm interface.

Notes
The DXP platform is based on the object interfaces technology by Borland(TM), therefore TForm, TFrame, and other VCL controls to object interfaces are not passed into object interfaces that can be exposed to third party development in different programming systems. For example VCL technology is not compatible with MS C++ toolkit.

Therefore to work with windows in the Altium Designer platform, you use the IExternalForm interface to have access to windows and manipulate them. The IExternalFormHolder interface and the TExternalFormComponent class are used to work with Delphi windows in a server plugged into the Altium Designer platform.

IExternalFormHolder Methods and Properties Table

IExternalFormHolder methods
GetParentWindow
SetDialogHandle
IExternalFormHolder properties

See also
IExternalForm interface
TExternalFormComponent class in ExternalForm unit.

IExternalFormHolder Methods

GetParentWindow method

(IExternalFormHolder interface)
Syntax
Function GetParentWindow : THandle;
Description
This function retrieves the THandle of the parent window that can be used in the IExternalForm interface.
Example
See also
IExternalFormHolder interface

SetDialogHandle method

(IExternalFormHolder interface)
Syntax
Procedure SetDialogHandle (AHandle : THandle);
Description
This procedure sets the dialog handle for this external form.
Example
See also
IExternalFormHolder interface

IHTMLViewExternalForm interface

Overview
The IHTMLViewExternalForm interface represents a HTML document.

IHTMLViewExternalForm methods
GetCtrlClickInNewWindow
SetCtrlClickInNewWindow
NavigateTo
GetHTMLDocument
IHTMLViewExternalForm properties
CtrlClickInNewWindow

ISceneViewinterface

Overview
The ISceneView interface represents a specific view.

ISceneView methods
CanClose
ISceneView properties

INavigationDocument

Overview
The INavigationDocument interface represents a specific navigation view.

INavigationDocument methods
GetDocumentScene
INavigationDocument properties

See also
IExternalForm interface

IServerView interface

Overview
The IServerView interface is the ancestor interface for a document or panel view object interface.
This IServerView interface also represents a global panel in Altium Designer, for example the Messages or ToDo panels.

The IServerView interface hierarchy is as follows;
IExternalForm
    IServerView interface

IServerView Methods and Properties Table

IServerView Methods
GetViewState
SetViewState
ReceiveNotification
IServerView Properties
IsPanel
ViewName

See also
IExternalForm interface
IServerDocumentView interface
IServerDocument interface

IServerView GetState and SetState methods

GetIsPanel method

(IServerView interface)
Syntax
Function  GetIsPanel : LongBool;
Description
The IsPanel property determines whether the IServerDocumentView object is a panel or not. A IServerDocument container stores IServerDocumentView objects and they are can be a panel view or a document view.
This property is supported by the GetIsPanel method.
Example

Var
ServerDocumentView : IServerDocumentView;
Begin
ServerDocumentView := ServerDocument.View[j];
If Not(ServerDocumentView.IsPanel) Then 
      ShowMessage('Document Name ' + ServerDocument.FileName);
End;

See also
IClient interface
IExternalForm interface

GetViewName method

(IServerView  interface)
Syntax
Function GetViewName : Widestring;
Description
The ViewName property represents the view name and is not the same as the document filename. A view can be a global panel that can be seen globally within Altium Designer, as a document view or as a panel view.
This read only property is supported by the GetViewName method.
For example a library document open in Altium Designer yields the following information:
View Name: PCBEditor
Document Name: C:\Program Files\Altium Designer\Examples\Reference Designs\4 Port Serial Interface\Libraries\4 Port Serial Interface.PcbLib
Caption: PCBView_GraphicalForm
ViewName example
If StrPas(Client.CurrentView.GetViewName) <> UpperCase('PCBLib') Then Exit;
This code snippet uses the Client.CurrentView.ViewName method to find out the current document’s type name.
See also
IClient interface
IServerView interface
IExternalForm interface

IServerView Methods

GetViewState method

(IServerView interface)
Syntax
Function  GetViewState : Widestring;
Description
Example
 
See also
IClient interface
IServerView interface
SetViewState method

ReceiveNotification method

(IServerView interface)
Syntax
Procedure ReceiveNotification (Const ANotification : INotification);
Description
The ReceiveNotification procedure captures the notification generated by Altium Designer. A global panel, a document view or a panel view has the ability to intercept a notification and take action accordingly.
Example
 
See also
IClient interface
IServerView interface
INotification interface

SetViewState method

(IServerView interface)
Syntax
Procedure SetViewState(Const Astate : Widestring);
Description
Example
 
See also
IClient interface
IExternalForm interface
GetViewState method

IServerView Properties

IsPanel property

(IServerView interface)
Syntax
Property IsPanel : LongBool Read GetIsPanel;
Description
The IsPanel property returns a boolean value denoting whether the view is a panel or a document view.
A document consists of a document view and at least one panel view. There also can be global or system views such as Message panel which is a global panel view.
This read only property is supported by the GetIsPanel method.
Example

Var
ServerDocumentView : IServerDocumentView;
Begin
ServerDocumentView := ServerDocument.View[j];
If Not(ServerDocumentView.IsPanel) Then 
      ShowMessage('Document Name ' + ServerDocument.FileName);
End;

See also
IServerView interface

ViewName property

(IServerView interface)
Syntax
Property ViewName : Widestring    Read GetViewName;
Description
The ViewName property represents the view name and is not the same as the document filename. A view can be a global panel that can be seen globally within Altium Designer, as a document view or as a panel view.
This read only property is supported by the GetViewName method.
For example a library document open in Altium Designer yields the following information:
View Name: PCBEditor
Document Name: C:\Program Files\Altium Designer\Examples\Reference Designs\4 Port Serial Interface\Libraries\4 Port Serial Interface.PcbLib
Caption: PCBView_GraphicalForm
ViewName example
If StrPas(Client.CurrentView.ViewName) <> UpperCase('PCBLib') Then Exit;
This code snippet uses the Client.CurrentView.ViewName method to find out the current document’s type.
See also
IClient interface
IServerView interface

IServerDocumentView Interface

Overview
The IServerDocumentView represents either the document view or one of the associated panel views in Altium Designer. This interface is inherited from the IServerView interface.
The IServerDocument interface contains IServerDocumentView interfaces, that is, a design document open in Altium Designer contains links to a document view and at least one panel view.

The hierarchy is as follows;
IExternalForm
    IServerView interface
        IServerDocumentView interface

IExternalForm methods
SetParentWindow
ParentWindowCreated
ParentWindowDestroyed
GetBounds
Hide
SetBounds
SetFocus
Show
FocusFirstTabStop
IExternalForm properties
Caption
Handle
IServerView Methods
GetViewState
SetViewState
ReceiveNotification
IServerView Properties
IsPanel
ViewName

IServerDocumentView Methods and Properties Table

IServerDocumentView Methods
GetOwnerDocument
PerformAutoZoom
UpdateStatusBar
IServerDocumentView Properties
OwnerDocument

See also
IClient interface
IServerModule interface
IServerDocument interface
IServerView interface
IExternalForm interface

IServerDocumentView GetState and SetState Methods

GetOwnerDocument method

(IServerDocumentView interface)
Syntax
Function GetOwnerDocument : IServerDocument;
Description
The OwnerDocument property returns the IServerDocument interface that the IServerDocumentView itnerface is associated with. An IServerDocument container stores IServerDocumentView interfaces which represent a document or panel view.
This read only property is supported by the GetOwnerDocument method.
Example
 
See also
IClient interface
IServerDocumentView interface

IServerDocumentView Methods

PerformAutoZoom method

(IServerDocumentView interface)
Syntax
Procedure PerformAutoZoom;
Description
This procedure forces a refresh or repaint of the document / panel view.
Example
 
See also
IClient interface
IServerDocumentView interface

UpdateStatusBar method

(IServerDocumentView interface)
Syntax
Procedure UpdateStatusBar;
Description
This procedure forces an update of the status bar when a string is submitted to the status bar.
Example
 
See also
IClient interface
IServerDocumentView interface

IServerDocumentView Properties
OwnerDocument property

(IServerDocumentView interface)
Syntax
Property OwnerDocument : IServerDocument Read GetOwnerDocument;
Description
This property returns the IServerDocument interface that the IServerDocumentView interface is associated with. An IServerDocument container stores IServerDocumentView interfaces which represent a document or panel view.
This read only property is supported by the GetOwnerDocument method.
Example
 
See also
IClient interface
IExternalForm interface

IServerDocument Interface

Overview
The IServerDocument interface represents the document container. Each IServerDocument interface is a document containter made up of views of the same kind.
A view can be a design document form or a panel form.
Every document editor server (encapsulated by the IServerModule interface) that supports creation of documents will have a IServerDocument interface.

The IServerDocument interface hierarchy is as follows;

IServerDocument Methods and Properties Table

IServerDocument methods
AddView
SetModified
SetIsShown
SetBeingClosed
Focus
DoFileLoad
DoFileSave
SupportsReload
GetCanClose
GetCount
GetFileName
SetFileName
GetKind
GetModified
GetIsShown
GetBeingClosed
GetFileModifiedDate
UpdateModifiedDate
GetServerModule
GetView
GetViewByName
NotifyViews
GetSupportsOwnSave
GetContextHelpTopicName
SetFileModifiedDate
WarnIfOwnedByOther
AcquireFileOwnership
ReleaseFileOwnership
ReleaseDataFileHandle
AcquireDataFileHandle
OwnsFile
DoSafeFileSave
DoSafeChangeFileNameAndSave
CreateSnippetFile
ZoomSnippetContents
GetSnippetView
PlaceSnippet
CanPlaceSnippet
CanCreateSnippet
IServerDocument properties
CanClose
Count
FileName
Kind
Modified
IsShown
BeingClosed
ServerModule
View
SupportsOwnSave

IServerDocument example

Procedure OpenAndShowADocument(Filename : TDynamicString);
Var
    ReportDocument : IServerDocument;
Begin
    If Client = Nil Then Exit;
    ReportDocument  := Client.OpenDocument('Text',FileName);
    If ReportDocument <> Nil Then
          Client.ShowDocument(ReportDocument);
End;

See also
IClient interface
IServerDocumentView interface
IServerView interface
CS server example in the \Developer Kit\Examples\DXP\ClientServer Interfaces\ folder.

IServerDocument Methods

AddView method

(IServerDocument interface)
Syntax
Procedure AddView (Const AView : IServerDocumentView);
Description
This procedure adds a IServerDocumentView object in the server document. A IServerDocument object is a container containing views of document views and panel views.
Example
See also
IServerDocument interface
IServerDocumentView interface

DoFileLoad method

(IServerDocument interface)
Syntax
Function DoFileLoad : LongBool;
Description
This function allows the re-loading of the document. This is useful if the document has been modified and saved and it needs to be re-loaded to ensure that the document is in the latest state.
Example
See also
IServerDocument interface

DoFileSave method

(IServerDocument interface)
Syntax
Function DoFileSave (Const AKind : Widestring) : LongBool;
Description
This function provides you an option to save the document in a different format if the document supported by the specific document editor provides the option of saving in a different format other than the default format. Normally these file formats are stored in the SaveFilters block within the EditorWindowKind section within a server installation file (with an INS extension).
File Formats
For example with PCB documents in Altium Designer, you can save them as a PCB ASCII format, PCB Binary 3 format etc - PCB Binary, PCB 3.0 Binary, PCB 4.0 Binary, PCB ASCII. By default its PCB Binary 5.0.
With Schematic documents, you can save them as a Advanced Schematic binary, Advanced Schematic ascii, Schematic binary 4.0, Orcad SDT Schematic, Advanced Schematic template.
Server Installation files
The file formats supported by editors can be found in the server installation files within the SaveFilters - End blocks.
DelphiScript Example

Var
    Board           : IPCB_Document;
    AView           : IServerDocumentView;
    AServerDocument : IServerDocument;
Begin
    // save the file in a different PCB format
    //check if current document is a PCB document otherwise exit!
    Board := PCBServer.GetCurrentPCBBoard;
    If Board = Nil Then Exit;
    If Client = Nil Then Exit;
 
    // Grab the current document view using the Client's Interface.
    AView := Client.GetCurrentView;
    AServerDocument := AView.OwnerDocument;
    AServerDocument.DoFileSave('PCB ASCII');
    Close;
End;

See also
IServerDocument interface
IServerDocument interface
GetCanClose method
GetModified method
GetFileName method

Focus method

(IServerDocument interface)
Syntax
Procedure Focus;
Description
The procedure forces the document to be the focussed document in Altium Designer. A focussed document is the top level document and in view in Altium Designer workspace that responds to commands etc.
Example
See also
IServerDocument interface

GetBeingClosed method

(IServerDocument interface)
Syntax
Function GetBeingClosed : LongBool;
Description
The function determines whether the server document is being closed or not. Use the GetCanClose function to check if the document can be closed or not.
Example
See also
IServerDocument interface
GetCanClose method
GetModified method
GetFileName method
DoFileSave method

GetCanClose method

(IServerDocument interface)
Syntax
Function GetCanClose : LongBool;
Description
This function checks whether the document can be closed or not. This method is used for the CanClose property.
Example
See also
IServerDocument interface
GetModified method
GetFileName method
DoFileSave method

GetContextHelpTopicName method

(IServerDocument interface)
Syntax
Function GetContextHelpTopicName : Widestring;
Description
The GetContextHelpTopicName function retrieves the help topic name for the document. Normally the returned string would be the ServerModuleName.DocumentKind format for example 'SCH.SCH' Some servers provide more detailed information, for example Schematic Editor server returns Sch.Sheet.Port when the mouse is over the Port object on a schematic sheet.
Notes
Third party developers can use this function to provide context sensitive help.
To implement the help for your server, you should have a .HELPID file in the Help folder where the link between the string returned by the GetContextHelpTopicName and the actual help document is established.
For example the CXTSystemDesignCapture.HelpID contains a Sch.Sheet.Port = CXTSystemDesignCapture.chm,Document_Objects\Port.htm. This means when the F1 key is pressed and the Sch.Sheet.Port string is returned, it will use the CXTSystemDesignCapture.chm filename and display the Document_Objects\Port.htm topic.
Example
See also
IServerDocument interface

GetCount method

(IServerDocument interface)
Syntax
Function GetCount : Integer;
Description
The Count property returns the number of views (of the same type) in the IServerDocument container. Use in conjunction with the View property.
This method is used for the Count property.
Example

Var
    ServerModule       : IServerModule;
    ServerDocument     : IServerDocument;
    ServerDocumentView : IServerDocumentView;
Begin
ServerModule := Client.ServerModuleByName['PCB'];
If ServerModule = Nil Then Exit;
            
For I := 0 to ServerModule.DocumentCount - 1 Do
Begin
    ServerDocument := ServerModule.Documents[I];
    ShowMessage('Document View Count ' + 
    IntToStr(ServerDocument.Count) + #13 +
                'Kind ' + ServerDocument.Kind));
End;
End;

See also
IServerDocument interface

GetFileModifiedDate method

(IServerDocument interface)
Syntax
Function GetFileModifiedDate: TDateTime;
Description
This function returns the date and time of the modified file.
Example
See also
IServerDocument interface
GetFileModifiedDate method
SetFileModifiedDate method
TDateTime type from Borland Delphi Run Time Library.

GetFileName method

(IServerDocument interface)
Syntax
Function GetFileName : Widestring;
Description
This function retrieves the file name as a string for the server document. Note a server document can be a document view or a panel view, and thus if it is a panel view, the GetFileName method is invalid.
Example

ServerDocumentView := ServerDocument.View[j];
If Not(ServerDocumentView.IsPanel) Then 
    ShowMessage('  Document Name ' + 
                ServerDocument.FileName);

See also
IServerDocument interface

GetIsShown method

(IServerDocument interface)
Syntax
Function GetIsShown : LongBool;
Description
The IsShown property denotes whether or not this document is displayed in Altium Designer. This property is supported by the GetIsShown and SetIsShown methods.
Example
See also
IServerDocument interface

GetKind method

(IServerDocument interface)
Syntax
Function GetKind : Widestring;
Description
This function returns the Kind string for this document and this function is used for the Kind property. Examples include ‘PCB’, ‘PCBLIB’,’SCH’,’SCHLIB’ etc.
Example

ServerModule := Client.ServerModuleByName['PCB'];
If ServerModule = Nil Then Exit;
            
For I := 0 to ServerModule.DocumentCount - 1 Do
Begin
    ServerDocument := ServerModule.Documents[I];
    ShowMessage('Document View Count ' + 
         IntToStr(ServerDocument.Count) + #13 +
                'Kind ' + ServerDocument.GetKind));
End;

See also
IServerDocument interface

GetModified method

(IServerDocument interface)
Syntax
Function GetModified : LongBool;
Description
The Modified property denotes whether this document has been modified or not, and can be taken as a “dirty” flag, that is a document has been modified and it has been marked dirty.
This property is supported by the GetModified and SetModified methods.
Example

Var
    AView           : IServerDocumentView;
    AServerDocument : IServerDocument;
Begin
    If Client = Nil Then Exit;
    // Grab the current document view using the Client's Interface.
    AView := Client.GetCurrentView;
 
    // Grab the server document which stores views by extracting the ownerdocument field.
    AServerDocument := AView.OwnerDocument;
 
    // Set the document dirty.
    AServerDocument.Modified := True;
End;

See also
IServerDocument interface

GetServerModule method

(IServerDocument interface)
Syntax
Function GetServerModule : IServerModule;
Description
The ServerModule is a read-only property which returns the IServerModule interface that the document is associated with. The server module represents the server object installed and running in Altium Designer.
A server module manages its own documents and panels. This property is supported by the GetServerModule method.
Example

//IServerModule interface
ServerModule := Client.ServerModuleByName['PCB'];
If ServerModule = Nil Then Exit;
 
ShowMessage(IntToStr(ServerModule.DocumentCount));
For I := 0 to ServerModule.DocumentCount - 1 Do
Begin
    //IServerDocument interface
    ServerDocument := ServerModule.Documents[I];
    // do what you want with server documents
End;

See also
IServerDocument interface
IServerModule interface

GetSupportsOwnSave method

(IServerDocument interface)
Syntax
Function GetSupportsOwnSave : LongBool;
Description
The SupportsOwnSave property returns a boolean value whether a save routine has been provided to save these documents associated with the server. This is a read only property and is supported by the GetSupportsOwnSave method.
Example
See also
IServerDocument interface

GetView method

(IServerDocument interface)
Syntax
Function GetView (Index : Integer) : IServerDocumentView;
Description
The View property is an indexed property and represents a document or panel view. The IServerDocument.Count method returns the list of views (which could be document or panel windows) as part of the IServerDocument container.
This property is supported by the GetView method.
Example

For J := 0 to ServerDocument.Count - 1 Do
Begin
    ServerDocumentView := ServerDocument.View[j];
    ShowMessage('View Name ' + ServerDocumentView.ViewName);
 
    If Not(ServerDocumentView.IsPanel) Then 
        ShowMessage('  Document Name ' +
                    ServerDocument.FileName);
End;

See also
IServerDocument interface

GetViewByName method

(IServerDocument interface)
Syntax
Function GetViewByName (Const ViewName : Widestring) : IServerDocumentView;
Description
The GetViewByName function returns the View object which represents a document or panel view.
Example

ServerDocumentView := ServerDocument.GetViewByName(PCBExpressionFilter);
If ServerDocumentView.IsPanel Then 
    ShowMessage('This Server Document View is a Panel');

See also
IServerDocument interface
IServerDocumentView interface

SetBeingClosed method

(IServerDocument interface)
Syntax
Procedure SetBeingClosed (Const Value : LongBool);
Description
The BeingClosed property denotes that this design document is being closed before this design document can be successfully destroyed. This property is a read only property. You can check the status of the document before you attempt to modify or update the document before it is being closed.
This property is supported by the GetBeingClosed and SetBeingClosed methods.
Example
See also
IServerDocument interface

SetFileModifiedDate method

(IServerDocument interface)
Syntax
Procedure SetFileModifiedDate(Const AValue : TDateTime);
Description
The procedure sets the modified date for the document if the document has been modified by an outside agent.
Example
See also
IServerDocument interface
GetModified method
SetModified method

SetFileName method

(IServerDocument interface)
Syntax
Function SetFileName (Const AFileName : Widestring): Widestring;
Description
The SetFileName function sets the filename for the document.
Example
See also
IServerDocument interface

SetIsShown method

(IServerDocument interface)
Syntax
Procedure SetIsShown (Const Value : LongBool);
Description
The IsShown property denotes whether or not this document is displayed in Altium Designer. This property is supported by the GetIsShown and SetIsShown methods.
Example
See also
IServerDocument interface

SetModified method

(IServerDocument interface)
Syntax
Procedure SetModified (Const Value : LongBool);
Description
The Modified property denotes whether this document has been modified or not, and can be taken as a “dirty” flag, that is a document has been modified and it has been marked dirty.
This property is supported by the GetModified and SetModified methods.
Example

Var
    AView           : IServerDocumentView;
    AServerDocument : IServerDocument;
Begin
    If Client = Nil Then Exit;
    // Grab the current document view using the Client's Interface.
    AView := Client.GetCurrentView;
 
    // Grab the server document which stores views by extracting the ownerdocument field.
    AServerDocument := AView.OwnerDocument;
 
    // Set the document dirty.
    AServerDocument.Modified := True;
End;

See also
IServerDocument interface

NotifyViews method

(IServerDocument interface)
Syntax
Procedure NotifyViews (ANotification : INotification);
Description
This procedure sends a notification to all the views associated with the IServerDocument container.
Example
See also
IServerDocument interface
INotification interface

SupportsReload method

(IServerDocument interface)
Syntax
Function SupportsReload : LongBool;
Description
This method determines whether the document in Altium Designer can be re loaded or not (to refresh and to make sure that the document state is the latest).
Example
See also
IServerDocument interface
DoFileLoad method

UpdateModifiedDate method

(IServerDocument interface)
Syntax
Procedure UpdateModifiedDate;
Description
The procedure updates the modified document's date after this document has been modified.
Example
See also
IServerDocument interface
GetModified method
SetModified method

ReleaseFileOwnership method

(IServerDocument interface)
Syntax
Procedure ReleaseFileOwnership;
Description
For internal use only.
Example
See also
IServerDocument interface

ReleaseDataFileHandle method

(IServerDocument interface)
Syntax
Procedure ReleaseDataFileHandle;
Description
For internal use only.
Example
See also
IServerDocument interface

OwnsFile method

(IServerDocument interface)
Syntax
Function OwnsFile : Boolean;
Description
The OwnsFile function determines whether the document is owned by the Altium Designer product and thus this document can be saved or not.
Example
See also
IServerDocument interface

DoSafeFileSave method

(IServerDocument interface)
Syntax
Function DoSafeFileSave (Const AKind : Widestring) : LongBool;
Description
The function determines whether the document can be saved of specified document type safely.
Example
See also
IServerDocument interface

DoSafeChangeFileNameAndSave method

(IServerDocument interface)
Syntax
Function DoSafeChangeFileNameAndSave(Const ANewFileName, AKind : Widestring) : LongBool;
Description
The function determines whether the current document can be saved with the new file name and new document type or not.
Example
See also
IServerDocument interface

AcquireFileOwnership method

(IServerDocument interface)
Syntax
Procedure AcquireFileOwnership;
Description
For internal use only.
Example
See also
IServerDocument interface

AcquireDataFileHandle method

(IServerDocument interface)
Syntax
Procedure AcquireDataFileHandle;
Description
For internal use only.
Example
See also
IServerDocument interface

WarnIfOwnedByOther method

(IServerDocument interface)
Syntax
Function WarnIfOwnedByOther(AWarningLevel : TFileOwnershipWarningLevel) : LongBool;
Description
This function determines whether the document is owned by another user. A document can be shared amongst other users but the other users cannot save this document when this document is owned solely by one user.
Example
See also
IServerDocument interface

IServerDocument Properties
BeingClosed property

(IServerDocument interface)
Syntax
Property  BeingClosed : LongBool Read GetBeingClosed Write SetBeingClosed;
Description
The BeingClosed property denotes that this design document is being closed before this design document can be successfully destroyed. This property is a read only property. You can check the status of the document before you attempt to modify or update the document before it is being closed.
This property is supported by the GetBeingClosed and SetBeingClosed methods.
Example
 
See also
IClient interface
IServerDocument interface

CanClose property

(IServerDocument interface)
Syntax
Property  CanClose : LongBool Read GetCanClose;
Description
This CanClose property determines whether the document can be closed or not.
Example
 
See also
IClient interface
IServerDocument interface

Count property

(IServerDocument interface)
Syntax
Property Count : Integer Read GetCount;
Description
The Count property returns the number of views (of the same type) in the IServerDocument container. Use in conjunction with the View property.
This property is supported by the GetCount method.
Example

Var
    ServerModule       : IServerModule;
    ServerDocument     : IServerDocument;
    ServerDocumentView : IServerDocumentView;
Begin
ServerModule := Client.ServerModuleByName['PCB'];
If ServerModule = Nil Then Exit;
            
For I := 0 to ServerModule.DocumentCount - 1 Do
Begin
    ServerDocument := ServerModule.Documents[I];
    ShowMessage('Document View Count ' + 
    IntToStr(ServerDocument.Count) + #13 +
                'Kind ' + ServerDocument.Kind));
End;
End;

See also
IClient interface
IServerDocument interface

Filename property

(IServerDocument interface)
Syntax
Property  FileName : Widestring Read GetFileName;
Description
The FileName property returns the filename for the server document (not the corresponding server panel). This property is a read-only property and is supported by the GetFileName method.
Note a server document can be a document view or a panel view, and thus if it is a panel view, the FileName property is invalid.
Example

ServerDocumentView := ServerDocument.View[j];
If Not(ServerDocumentView.IsPanel) Then 
    ShowMessage('  Document Name ' + 
                ServerDocument.FileName);

See also
IClient interface
IServerDocument interface

IsShown property

(IServerDocument interface)
Syntax
Property  IsShown : LongBool Read GetIsShown     Write SetIsShown;
Description
This property denotes whether or not this document is displayed in Altium Designer. This property is supported by the GetIsShown and SetIsShown methods.
Example
 
See also
IClient interface
IServerDocument interface

Kind property

(IServerDocument interface)
Syntax
Property Kind : Widestring Read GetKind;
Description
The Kind reports the type of the document opened in Altium Designer.
Examples include ‘PCB’, ‘PCBLIB’,’SCH’,’SCHLIB’ etc. This property is a read-only property. This property is supported by the GetKind method.
Example

ServerModule := Client.ServerModuleByName['PCB'];
If ServerModule = Nil Then Exit;
            
For I := 0 to ServerModule.DocumentCount - 1 Do
Begin
    ServerDocument := ServerModule.Documents[I];
    ShowMessage('Document View Count ' + 
         IntToStr(ServerDocument.Count) + #13 +
                'Kind ' + ServerDocument.Kind));
End;

See also
IClient interface
IServerDocument interface

Modified property

(IServerDocument interface)
Syntax
Property Modified : LongBool Read GetModified Write SetModified;
Description
The Modified property denotes whether this document has been modified or not, and can be taken as a “dirty” flag, that is a document has been modified and it has been marked dirty.
This property is supported by the GetModified and SetModified methods.
Example

Var
    AView           : IServerDocumentView;
    AServerDocument : IServerDocument;
Begin
    If Client = Nil Then Exit;
    // Grab the current document view using the Client's Interface.
    AView := Client.GetCurrentView;
 
    // Grab the server document which stores views by extracting the ownerdocument field.
    AServerDocument := AView.OwnerDocument;
 
    // Set the document dirty.
    AServerDocument.Modified := True;
End;

See also
IClient interface
IServerDocument interface

ServerModule property

(IServerDocument interface)
Syntax
Property  ServerModule : IServerModule Read GetServerModule;
Description
The ServerModule is a read-only property which returns the IServerModule interface that the document is associated with. The server module represents the server object installed and running in Altium Designer.
A server module manages its own documents and panels. This property is supported by the GetServerModule method.
Example

//IServerModule interface
ServerModule := Client.ServerModuleByName['PCB'];
If ServerModule = Nil Then Exit;
 
ShowMessage(IntToStr(ServerModule.DocumentCount));
For I := 0 to ServerModule.DocumentCount - 1 Do
Begin
    //IServerDocument interface
    ServerDocument := ServerModule.Documents[I];
    // do what you want with server documents
End;

See also
IClient interface
IServerDocument interface
IServerModule interface

SupportsOwnSave property

(IServerDocument interface)
Syntax
Property  SupportsOwnSave : LongBool Read GetSupportsOwnSave;
Description
The SupportsOwnSave property returns a boolean value whether a save routine has been provided to save these documents associated with the server. Read only property.
Example
 
See also
IClient interface
IServerDocument interface

View property

(IServerDocument interface)
Syntax
Property View[Index : Integer] : IServerDocumentView Read GetView;
Description
The View property is an indexed property and represents a document or panel view part of the IDocument container associated with a specific IServerModule interface. The IServerDocument.Count method returns the list of views (which could be document or panel windows) as part of the IServerDocument container.
This property is supported by the GetView method.
Example

For J := 0 to ServerDocument.Count - 1 Do
Begin
    ServerDocumentView := ServerDocument.View[j];
    ShowMessage('View Name ' + ServerDocumentView.ViewName);
 
    If Not(ServerDocumentView.IsPanel) Then 
        ShowMessage('  Document Name ' +
                    ServerDocument.FileName);
End;

See also
IClient interface
IServerDocument interface

IHighlightedDocument Interface

Overview
This IHighlightedDocument interface represents a mechanism that deals with highlighting of objects on a design document (especially Schematic and PCB documents) in Altium Designer when objects are being selected or deselected and when being masked or not.

This interface and its methods are for internal use.

Notes
The IHighlightedDocument interface is inherited from the IServerDocument interface.

IHighlightedDocument Methods and Properties Table

IHighlightedDocument methods
HL_Begin
HL_End
HL_Perform
HL_HighlightMethod_Add
HL_HighlightMethod_Remove
HL_HighlightMethod_Clear
HL_HighlightMethod_IsApplicable
HL_Register_DMObject
HL_Register_NetItem
HL_Register_Net
HL_Register_Bus
HL_Register_Part
HL_Register_Component
HL_Register_VHDLEntity
HL_UnRegister_Object
HL_UnRegister_AllObjects
HL_ObjectCount
HL_Objects
HL_SetHighlightedNet
HL_GetHighlightedNet
HL_GetLinkedObject
HL_ChooseObjectGraphically
HL_XProbeChooseObject
HL_HighlightedNet
IHighlightedDocument properties
Property  HL_HighlightedNet : INet

See also
IServerDocument interface

IServerPanelInfo Interface

Overview
The IServerPanelInfo interface encapsulates the details of a panel in Altium Designer and the details can be Name, Bitmap, whether the panel can be docked horizontally or vertically and so on.
This interface is used by the IServerRecord interface and the IClient interface.

IServerPanelInfo Methods and Properties Table

IServerPanelInfo methods
GetName
GetCategory
GetBitmap
GetHotkey
GetButtonVisible
GetMultipleCreation
GetCreationClassName
GetCanDockVertical
GetCanDockHorizontal
SupportsDocumentKind
SupportsProjectKind
GetDocumentKindCount
GetDocumentKinds
GetProjectKindCount
GetProjectKinds
IServerPanelInfo properties
DocumentKindCount
DocumentKinds[Index
ProjectKindCount
ProjectKinds

See also
IServerRecord interface
IClient Interface

IServerPanelInfo Methods

GetBitmap method

(IServerPanelInfo interface)
Syntax
Function GetBitmap : Widestring;
Description
The function returns the name of the bitmap.
Example
See also
IServerPanelInfo interface

GetButtonVisible method

(IServerPanelInfo interface)
Syntax
Function GetButtonVisible : Boolean;
Description
The function returns whether the button on the panel is visible or not.
Example
See also
IServerPanelInfo interface

GetCanDockHorizontal method

(IServerPanelInfo interface)
Syntax
Function GetCanDockHorizontal: Boolean;
Description
This function determines whether the panel can be docked horizontally to the Altium Designer User Interface.
Example
See also
IServerPanelInfo interface

GetCanDockVertical method

(IServerPanelInfo interface)
Syntax
Function GetCanDockVertical : Boolean;
Description
This function determines whether the panel can be docked vertically to the Altium Designer User Interface.
Example
See also
IServerPanelInfo interface

GetCategory method

(IServerPanelInfo interface)
Syntax
Function GetCategory : Widestring;
Description
This function returns the Category string, ie which module it is part of within Altium Designer. For example the Favorites panel is part of the System.
Example
See also
IServerPanelInfo interface

GetCreationClassName method

(IServerPanelInfo interface)
Syntax
Function GetCreationClassName: Widestring;
Description
Internal use.
Example
See also
IServerPanelInfo interface

GetDocumentKindCount method

(IServerPanelInfo interface)
Syntax
Function GetDocumentKindCount : Integer;
Description
This function reports how many document kinds this panel can be associated with. For example with Simulation Breakpoints panel, it can be associated with VHDL and VHDTST documents.
Use this function with the GetDocumentKinds function.
Example
See also
IServerPanelInfo interface

GetDocumentKinds method

(IServerPanelInfo interface)
Syntax
Function GetDocumentKinds(Index : Integer) : WideString;
Description
This function returns the indexed Document Kind string that this panel is associated with. For example with Simulation Breakpoints panel, it can be associated with VHDL and VHDTST documents. This function is to be used in conjunction with the GetDocumentKindCount function.
Example
See also
IServerPanelInfo interface

GetHotkey method

(IServerPanelInfo interface)
Syntax
Function GetHotkey : Widestring;
Description
The function returns the HotKey string that is used to render the panel visible or not.
Example
See also
IServerPanelInfo interface

GetMultipleCreation method

(IServerPanelInfo interface)
Syntax
Function GetMultipleCreation : Boolean;
Description
Internal use.
Example
See also
IServerPanelInfo interface

GetName method

(IServerPanelInfo interface)
Syntax
Function GetName : Widestring;
Description
This function returns the name of the panel. For example the PCB Library panel has a PCBLibPanel name.
Example
See also
IServerPanelInfo interface

GetProjectKindCount method

(IServerPanelInfo interface)
Syntax
Function GetProjectKindCount : Integer;
Description
Internal use.
Example
See also
IServerPanelInfo interface

GetProjectKinds method

(IServerPanelInfo interface)
Syntax
Function GetProjectKinds(Index : Integer) : WideString;
Description
Internal use.
Example
See also
IServerPanelInfo interface

SupportsDocumentKind method

(IServerPanelInfo interface)
Syntax
Function SupportsDocumentKind(Const AKind : Widestring) : Boolean;
Description
This function determines whether the document kind is supported by the panel.
Example
See also
IServerPanelInfo interface

SupportsProjectKind method

(IServerPanelInfo interface)
Syntax
Function SupportsProjectKind (Const AKind : Widestring) : Boolean;
Description
Internal use.
Example
See also
IServerPanelInfo interface

IServerPanelInfo Properties

DocumentKindCount property

(IServerPanelInfo interface)
Syntax
Property DocumentKindCount : Integer read GetDocumentKindCount;
Description
This property reports how many document kinds this panel can be associated with. For example with Simulation Breakpoints panel, it can be associated with VHDL and VHDTST documents.
Use this property with the DocumentKinds property.
Example
See also
IServerPanelInfo interface

DocumentKinds property

(IServerPanelInfo interface)
Syntax
Property DocumentKinds[Index : Integer] : WideString read GetDocumentKinds;
Description
This property returns the indexed Document Kind string that this panel is associated with. For example with Simulation Breakpoints panel, it can be associated with VHDL and VHDTST documents. This property is to be used in conjunction with the GetDocumentKindCount function.
Example
See also
IServerPanelInfo interface

ProjectKindCount property

(IServerPanelInfo interface)
Syntax
Property ProjectKindCount : Integer read GetProjectKindCount;
Description
Internal use
Example
See also
IServerPanelInfo interface

ProjectKinds property

(IServerPanelInfo interface)
Syntax
Property ProjectKinds[Index : Integer] : WideString read GetProjectKinds;
Description
Internal use
Example
See also
IServerPanelInfo interface

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

The features available depend on your Altium product access level. Compare features included in the various levels of Altium Designer Software Subscription and functionality delivered through applications provided by the Altium 365 platform.

If you don’t see a discussed feature in your software, contact Altium Sales to find out more.