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
Application Related
| Object | Type | Description |
|---|---|---|
| App | IApplication | Object for accessing the application |
| Context | IContext | Object for accessing the execution context |
| Errors | IErrors | Object for accessing error information |
| Output | IOutput | Access object for the output service |
| Search | ISearchManager | Access object for the search manager |
| Window | IWorkspaceWindow | Access object for the application window |
| Workspace | IWorkspace | Access object for the workspace |
Workspace Related
| Object | Type | Description |
|---|---|---|
| CurrentModel | IModel | Access object for the model selected in the current project |
| CurrentProject | IProject | Access object for the current project |
| EditorPage | IEditorPage | Access object for the editor page |
| ViewDefenitions | IViewDefinitions | Access object for view definition management |
| UI | ICommonUI | Access object for UI such as basic dialogs |