AGI Ui Application 11 Send comments on this topic.
DisplayAlerts Property (IAgUiApplication)
See Also  Example
Windows






Windows & Linux

Description

Set to true to display certain alerts and messages. Otherwise false. The default value is True.

Property type

Read-write property

Syntax

[Visual Basic .NET]
Public Property DisplayAlerts() As Boolean

[C#]
public bool DisplayAlerts {get; set;}

[Managed C++]
public: __property bool get_DisplayAlerts();
public: __property void set_DisplayAlerts(
bool
);

[Unmanaged C++]
public: HRESULT get_DisplayAlerts(
VARIANT_BOOL * pRetVal
);
public: HRESULT put_DisplayAlerts(
VARIANT_BOOL NewDisplayAlerts
);

[Java]
public bool getDisplayAlerts();public void setDisplayAlerts(
bool
);

Example

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; 
 
// You can also specify STK 32 and 64 bit versions 
// Get reference to running STK 32-bit instance 
//AgUiApplication uiApplication = System.Runtime.InteropServices.Marshal.GetActiveObject("STK11_x86.Application") as AgUiApplication; 
// Get reference to running STK 64-bit instance 
//AgUiApplication uiApplication = System.Runtime.InteropServices.Marshal.GetActiveObject("STK11_x64.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; 
 

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)

' You can also specify STK 32 and 64 bit versions
' Get reference to running STK 32-bit instance
'AgUiApplication uiApplication = System.Runtime.InteropServices.Marshal.GetActiveObject("STK11_x86.Application") as AgUiApplication;
' Get reference to running STK 64-bit instance
'AgUiApplication uiApplication = System.Runtime.InteropServices.Marshal.GetActiveObject("STK11_x64.Application") as 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)

See Also

© 2017 Analytical Graphics, Inc. All Rights Reserved.

STK 11.2.1 Programming Interface