UiApplication#

class ansys.stk.core.uiapplication.UiApplication#

Bases: IUiApplicationPartnerAccess

A root object of the Application Model.

Overview#

load_personality

Load a personality by its name.

activate

Activates the applicationโ€™s main window.

file_open_dialog

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.

create_object

Only works from local HTML pages and scripts.

file_save_as_dialog

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.

quit

Shuts down the application.

file_open_dialog_extension

Brings up a standard File Open Dialog and returns an object representing the selected file.

directory_picker_dialog

Brings up the Directory Picker Dialog and returns a selected directory name.

open_log_file

Specify the current log file to be written to.

log_message

Log the Message specified.

create_application

Create a new instance of the application model root object.

personality

Return a reference to the currently loaded personality.

visible

Get or set whether the main window is visible.

user_control

Get or set whether the application is user controlled.

windows

Return a collection of windows.

height

Get or set a height of the main window.

width

Get or set a width of the main window.

left

Get or set a vertical coordinate of the main window.

top

Get or set a horizontal coordinate of the main window.

window_state

Get or set the state of the main window.

most_recently_used_list

Return a collection most recently used files.

path

Return the complete path to the application, excluding the final separator and name of the application. Read-only String.

hwnd

Return an HWND handle associated with the application main window.

message_pending_delay

Get or set message-pending delay for server busy dialog (in milliseconds).

personality2

Return an new instance of the root object of the STK Object Model.

log_file

Get the current log files full path.

display_alerts

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

process_id

Get process id for the current instance.

Examples#

Close the STK desktop application

# AgUiApplication uiApplication: STK Application
uiApplication.shutdown()

Import detail#

from ansys.stk.core.uiapplication import UiApplication

Property detail#

property UiApplication.personality: Any#

Return a reference to the currently loaded personality.

property UiApplication.visible: bool#

Get or set whether the main window is visible.

property UiApplication.user_control: bool#

Get or set whether the application is user controlled.

property UiApplication.windows: IWindowsCollection#

Return a collection of windows.

property UiApplication.height: int#

Get or set a height of the main window.

property UiApplication.width: int#

Get or set a width of the main window.

property UiApplication.left: int#

Get or set a vertical coordinate of the main window.

property UiApplication.top: int#

Get or set a horizontal coordinate of the main window.

property UiApplication.window_state: ApplicationWindowState#

Get or set the state of the main window.

property UiApplication.most_recently_used_list: MostRecentlyUsedCollection#

Return a collection most recently used files.

property UiApplication.path: str#

Return the complete path to the application, excluding the final separator and name of the application. Read-only String.

property UiApplication.hwnd: int#

Return an HWND handle associated with the application main window.

property UiApplication.message_pending_delay: int#

Get or set message-pending delay for server busy dialog (in milliseconds).

property UiApplication.personality2: Any#

Return an new instance of the root object of the STK Object Model.

property UiApplication.log_file: str#

Get the current log files full path.

property UiApplication.display_alerts: bool#

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

property UiApplication.process_id: int#

Get process id for the current instance.

Method detail#

UiApplication.load_personality(self, pers_name: str) None#

Load a personality by its name.

Parameters:

pers_name : str

Returns:

None

UiApplication.activate(self) None#

Activates the applicationโ€™s main window.

Returns:

None

UiApplication.file_open_dialog(self, default_ext: str, filter: str, initial_dir: str) str#

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.

Parameters:

default_ext : str

filter : str

initial_dir : str

Returns:

str

UiApplication.create_object(self, prog_id: str, remote_server: str) Any#

Only works from local HTML pages and scripts.

Parameters:

prog_id : str

remote_server : str

Returns:

Any

UiApplication.file_save_as_dialog(self, default_ext: str, filter: str, initial_dir: str) str#

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.

Parameters:

default_ext : str

filter : str

initial_dir : str

Returns:

str

UiApplication.quit(self) None#

Shuts down the application.

Returns:

None

UiApplication.file_open_dialog_extension(self, allow_multi_select: bool, default_ext: str, filter: str, initial_dir: str) UiFileOpenDialogExtension#

Brings up a standard File Open Dialog and returns an object representing the selected file.

Parameters:

allow_multi_select : bool

default_ext : str

filter : str

initial_dir : str

Returns:

UiFileOpenDialogExtension

UiApplication.directory_picker_dialog(self, title: str, initial_dir: str) str#

Brings up the Directory Picker Dialog and returns a selected directory name.

Parameters:

title : str

initial_dir : str

Returns:

str

UiApplication.open_log_file(self, log_file_name: str, log_file_mode: ApplicationOpenLogFileMode) bool#

Specify the current log file to be written to.

Parameters:

log_file_name : str

log_file_mode : ApplicationOpenLogFileMode

Returns:

bool

UiApplication.log_message(self, msg_type: ApplicationLogMessageType, msg: str) None#

Log the Message specified.

Parameters:

msg_type : ApplicationLogMessageType

msg : str

Returns:

None

UiApplication.create_application(self) UiApplication#

Create a new instance of the application model root object.

Returns:

UiApplication