In the bottom panel, the user has typed:
currentElement = Repository.GetTreeSelectedObject()
They have pressed the Enter key, and the command has been displayed in the top panel. The user has then typed, in the lower panel:
When they press the Enter key, the Console displays this command and the output from the command.
The user then enters a third command:
Session.Output("SelectedElementGUID:" + currentElement.ElementGUID)
This results in the output shown here, in the upper panel:
This feature is available in the Corporate, Unified and Ultimate editions of Enterprise Architect.
Console commands are preceded by the ! character and instruct the console to perform an action.
The available console commands include:
- !clear - clears the console display
- !save - saves the console display to a file
- !help - prints a list of commands
- !close - closes the console
- !include <scriptname> - executes the named script item; scriptname is of the format GroupName.ScriptName (spaces are allowed in names)
- ? - lists commands (same as !help)
- ? <variable or function name> - outputs the value.
To list these commands on the 'Console' tab itself, type ? in the lower panel (without the preceding ! character) and press the.
If you intend to execute scripts, you might want to have the Script Library (Scripting window) open as well, so that you can see the scripts available to call. Select the 'Specialize > Tools > Script Library' ribbon option.