Skip to content

The VisualApplets Tcl Console#

VisualApplets offers a Tcl console.

To open the Tcl Console in VisualApplets:

  1. From menu Window, select Dock Windows and then Tcl Console.

    VA Opening Console

    The Tcl Console is immediately opened at the bottom of the VisualApplets program window:

    VA Tcl Console

Using the Tcl Console#

To use the Tcl Console in VisualApplets:

  1. From menu Window, select Dock Windows and then Tcl Console.

    VA Tcl Console

  2. Use the field Tcl Command to enter your Tcl commands.

  3. Strike the Return key to send your command. In the scrollable window (Tcl Console) above, all commands you have entered are displayed, together with information if the command could be carried out, and with according error messages if not. Tcl Console lists all commands you enter for design creation (via GUI options, key strokes, or in Tcl).

    Commands you entered via Tcl are marked by a preceding “>”.

    Errors are highlighted in red.

    VA Tcl Console Error

  4. Use the Tcl Console to get information about commands and their syntax: Just carry out the action (you want to define in your script) using the GUI options of VisualApplets (clicking, Drag&Drop, key strokes …) and read in the scrollable Tcl Console window how this action is defined in Tcl. You can use Copy&Paste to copy commands into your Tcl script.

  5. Use the Tcl Console to test the commands you want to enter into your script: Just enter the command in the Tcl Command field and check if the desired action is carried out by VisualApplets. You can use Copy&Paste to copy a successful command into your Tcl script.

Info

The Tcl Console window lists commands you enter for design creation: Not only commands you enter in Tcl, but also commands you give by using the VisualApplets GUI options. This is very helpful when you start using Tcl for VA designs, as you can easily get information about the correct Tcl commands and the according command syntax.

For a complete list of all VisualApplets-specific Tcl commands, refer to section Command Reference.

Starting Scripts from the Tcl Console#

You have three options to start a TCL script from the Tcl console:

Starting Scripts via File Drag&Drop#

To start a Tcl script:

  1. Drag the file from the Windows explorer and drop it in the Tcl Command input field. The Tcl source command is added automatically, and the slashes are reversed into the appropriate direction (forward):

    Dragging & Dropping Scripts into the Tcl Console

  2. Strike the Return key to start executing the script in VisualApplets.

Starting Scripts Manually#

You can also type the Source command manually:

  1. Type the command Source into the Tcl Command input field.
  2. Leave a space and type the path to the Tcl file and the name of the Tcl file directly after the command Source. If path or file name contain spaces, put path + file name into double quotes.
  3. Strike the Return key to start executing the script in VisualApplets.

Copying Tcl Code into the Console#

You can also simply copy Tcl code from the clipboard into the Tcl Command input field:

  1. Mark the code you want to execute in your Tcl script and copy it to the clipboard.
  2. Past the code from the clipboard into the Tcl Command input field.
  3. Strike the Return key to start executing the code in VisualApplets.

Quick Command Syntax Information#

To get information about the syntax of a command very quickly:

  1. Enter the name of the command into the Tcl Command input field, followed by a space and by a question mark.
  2. Press Enter.

The syntax of the parameter is displayed in the Tcl Console window.

Example:

Enter GetModules ? to get syntax information for command GetModules.

The Tcl Console window displays the required information:

Tcl Command Info

For detailed information about individual parameters and allowed values, refer to section Command Reference.

Back to top