Skip to main content

Global Objects

Overview

When implementing a script-based extension, you can directly access the following global objects.

Global objects are also available in scripts executed in the script editor.

For Python Scripts

In Python scripts, you can directly access global objects, just like in C#. However, object names are in camelCase, not PascalCase like in C#.

# C# App → Python app
project = app.Workspace.CurrentProject
output.WriteLine("sample", project.Name)

Within a handler, you can also access App from the argument context.

def my_handler(context: ICommandContext, commandParams: ICommandParams):
app = context.App
output = app.Workspace.Output
ObjectTypeDescription
AppIApplicationObject for accessing the application
ContextIContextObject for accessing the execution context
ErrorsIErrorsObject for accessing error information
OutputIOutputAccess object for the output service
SearchISearchManagerAccess object for the search manager
WindowIWorkspaceWindowAccess object for the application window
WorkspaceIWorkspaceAccess object for the workspace
ObjectTypeDescription
CurrentModelIModelAccess object for the model selected in the current project
CurrentProjectIProjectAccess object for the current project
EditorPageIEditorPageAccess object for the editor page
ViewDefenitionsIViewDefinitionsAccess object for view definition management
UIICommonUIAccess object for UI such as basic dialogs