AGI Ui Application 11 Send comments on this topic.
IAgUiApplication Interface





Description

IAgUiApplication represents a root of the Application Model.

Object Model




Public Methods

Public Method Activate Activates the application's main window.
Public Method CreateApplication Create a new instance of the application model root object.
Public Method CreateObject Only works from local HTML pages and scripts
Public Method DirectoryPickerDialog Brings up the Directory Picker Dialog and returns a selected directory name.
Public Method FileOpenDialog Brings up a common File Open dialog and returns the file name selected by the user. If the user canceled, returns an empty file name.
Public Method FileOpenDialogExt Brings up a standard File Open Dialog and returns an object representing the selected file.
Public Method FileSaveAsDialog Brings up a common File SaveAs dialog and returns the file name selected by the user. If the user canceled, returns an empty file name.
Public Method LoadPersonality Loads a personality by its name.
Public Method LogMsg Logs the Message specified.
Public Method OpenLogFile Specifies the current log file to be written to.
Public Method Quit Shuts down the application.

Public Properties

Public Property DisplayAlerts Set to true to display certain alerts and messages. Otherwise false. The default value is True.
Public Property Height Gets/sets a height of the main window.
Public Property HWND Returns an HWND handle associated with the application main window.
Public Property Left Gets/sets a vertical coordinate of the main window.
Public Property LogFile Gets the current log files full path.
Public Property MessagePendingDelay Gets/Sets message-pending delay for server busy dialog (in milliseconds )
Public Property MRUList Returns a collection most recently used files.
Public Property Path Returns the complete path to the application, excluding the final separator and name of the application. Read-only String.
Public Property Personality Returns a reference to the currently loaded personality.
Public Property Personality2 Returns an new instance of the root object of the STK Object Model
Public Property ProcessID Gets process id for the current instance.
Public Property Top Gets/sets a horizontal coordinate of the main window.
Public Property UserControl Gets/sets whether the application is user controlled.
Public Property Visible Gets/sets whether the main window is visible.
Public Property Width Gets/sets a width of the main window.
Public Property Windows Returns a collection of windows.
Public Property WindowState Gets/sets the state of the main window.

Example

Start STK and get a reference to IAgStkObjectRoot
[C#] Copy Code
// Create an instance of STK 
AgUiApplication uiApplication = new AgUiApplication(); 
uiApplication.LoadPersonality("STK"); 
uiApplication.Visible = true
 
// Get our IAgStkObjectRoot interface 
IAgStkObjectRoot stkRoot = uiApplication.Personality2 as IAgStkObjectRoot; 
 

Get a reference to the AgStkObjectRoot using the running STK instance
[C#] Copy Code
// Get reference to running STK instance 
AgUiApplication uiApplication = System.Runtime.InteropServices.Marshal.GetActiveObject("STK11.Application"as AgUiApplication; 
 
// Get our IAgStkObjectRoot interface 
IAgStkObjectRoot stkRoot = uiApplication.Personality2 as IAgStkObjectRoot; 
 

Get a reference to the AgStkObjectRoot with display alerts turned off.
[C#] Copy Code
// Get reference to running STK instance 
AgUiApplication uiApplication = System.Runtime.InteropServices.Marshal.GetActiveObject("STK11.Application"as AgUiApplication; 
 
//Create a new instance of the application model root object. 
AgUiApplication uiApplication2 = uiApplication.CreateApplication() as AgUiApplication; 
 
//Set DisplayAlerts to false to suppress certain alerts and messages. 
//This is useful when automating tasks. 
uiApplication2.DisplayAlerts = false
 
// Get our IAgStkObjectRoot interface with display alerts turned off 
IAgStkObjectRoot stkRoot = uiApplication2.Personality2 as IAgStkObjectRoot; 
 

Start STK and get a reference to IAgStkObjectRoot
[Visual Basic .NET] Copy Code
' Create an instance of STK
Dim uiApplication As New AgUiApplication()
uiApplication.LoadPersonality("STK")
uiApplication.Visible = True

' Get our IAgStkObjectRoot interface
Dim stkRoot As IAgStkObjectRoot = TryCast(uiApplication.Personality2, IAgStkObjectRoot)

Get a reference to the AgStkObjectRoot using the running STK instance
[Visual Basic .NET] Copy Code
' Get reference to running STK instance
Dim uiApplication As AgUiApplication = TryCast(System.Runtime.InteropServices.Marshal.GetActiveObject("STK11.Application"), AgUiApplication)

' Get our IAgStkObjectRoot interface
Dim stkRoot As IAgStkObjectRoot = TryCast(uiApplication.Personality2, IAgStkObjectRoot)

Get a reference to the AgStkObjectRoot with display alerts turned off.
[Visual Basic .NET] Copy Code
' Get reference to running STK instance
Dim uiApplication As AgUiApplication = TryCast(System.Runtime.InteropServices.Marshal.GetActiveObject("STK11.Application"), AgUiApplication)

'Create a new instance of the application model root object.
Dim uiApplication2 As AgUiApplication = TryCast(uiApplication.CreateApplication(), AgUiApplication)

'Set DisplayAlerts to false to suppress certain alerts and messages.
'This is useful when automating tasks.
uiApplication2.DisplayAlerts = False

' Get our IAgStkObjectRoot interface with display alerts turned off
Dim stkRoot As IAgStkObjectRoot = TryCast(uiApplication2.Personality2, IAgStkObjectRoot)

CoClasses that Implement IAgUiApplication

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1