Adding a Command to a Collection

To add commands to a collection via graphical user interface: 

  1. Right-click on the name of the script collection.
  2. From the context menu, select Create Element.

A dialog opens for describing the command you want to add. The fields highlighted in red are mandatory:

  1. Command Name (mandatory): Give a name to your command.
  2. Version: Version information for command.
  3. Description: The description will be visible as tooltip information. Enter a description of the procedure the command will call.
  4. Icon File: Provide the path to an icon file if you want a specific command icon to be displayed in the Script Collection pane or in the toolbar. Define the path relative to the collection file (*.xml). (See File Requirements for details). If you don't provide an icon file, a default icon will be used for representation in the GUI.
  5. Script File: Provide the path to and the name of the script that contains the procedure you want to be started via the command. Define the path relative to the collection file (*.xml)1.

  1. Command Options: Define how you want the command to be started on the VisualApplets GUI. A command can be started either via click on an according button (trigger mode), or by Drag & Drop into the design window (Drag & Drop mode). If you use trigger mode, you can add an additional button for the command in the tool bar of the program window and define under which conditions the command is carried out (scope).

  1. Trigger mode: To create a button that starts the command as soon as you click it, leave the Drag & Drop field unchecked. The command will be displayed in the Script Collection pane with the Run button:

    On the GUI, a simple click on the Run button starts executing the command.
  2. Drag & Drop mode: Check the Drag & Drop option if you want to start execution via Drag & Drop operation on the GUI. In this case, a hand icon is displayed in column Action:

  3. Toolbar option (only trigger mode): To make the command available in the toolbar of VisualApplets: Check the Add to Toolbar option (this is only possible if you leave Drag & Drop disabled). On the GUI, a new tool bar is created for the collection and the command icon is displayed:

    Clicking at the command icon in the tool bar has the same effect as clicking the Run button.
    The text you entered under Description is visible as tooltip information on the GUI:

  1. Define Command Scope (only trigger mode): If you need to define for which elements in the design the command (i.e., the underlying Tcl procedure) is to be carried out, check the Define Command Scope box. (Only available if you leave Drag & Drop disabled).

The elements you define here need to be selected in the design before starting the command from the GUI. If they are not selected at starting the command, the user will get an according prompt.

Multiple selection is allowed.

You have the following options:

  • Module: Exactly one design element must be selected. This element must be a module.
  • Link: Exactly one design element must be selected. This element must be a link.
  • CommentBox: Exactly one design element must be selected. This element must be a comment box.
  • SimModule: Exactly one design element must be selected. This element must be a simulation module.
  • SingleSelect: Exactly one design element must be selected. Which kind of element is selected (module, link, ...) is not relevant.
  • MultiSelect: Two ore more design elements must be selected. Which kinds of elements are selected (module, link, ...) is not relevant.

These options can be combined: If you, for example, combine the options Module and Link, the command will be carried out if the user on the GUI selects either exactly one module OR exactly one link. Combining SingleSelect and MultiSelect allows starting the command if one ore more design elements are selected.

The scope of a command (i.e., the scope of the Tcl procedure) is displayed in the Script Collection pane on the VA GUI: 



  1. Command Call: Define here how the command is called.

    1. Template: Enter here the template for the command call. Typically, it starts with the name of the Tcl procedure, followed by a list of parameters. The parameters are given as place holders, wrapped in %. For each place holder you define the according parameter in the list below. Follow the syntax of Tcl commands.2
    2. Parameters: Define here the parameters used in the template. The order of the parameters listed here is of no consequence. Just ensure that the parameter names match the place holder names of the template. To add a new parameter to the command definition, click the plus button.
    1. Name: Provide a name for each parameter. Use the name you used for the argument that carries the value at command call.
    2. Type: Define the data type of the parameter. You can define parameters of type string, integer, or double.
    3. Mode: Define if your parameter contains a fix value or a variable, or a drop position (dropX and dropY provide the position where the mouse pointer was released during drop3). If you define the parameter as variable, you will be asked at starting the command to enter a value for the parameter.
    4. Default: Enter here a default value.
    5. Min/Max: Enter here the value range for the parameter.
    6. Inc: Enter here the step size within the value range.

Example: