XML Syntax
All information regarding structure and content of a script collection is defined in one XML file. You can provide multiple XML files, each defining one script collection. If an XML file defining a script collection is located in the directory you specify in VisualApplets under menu Settings -> System Settings -> Paths -> Script Collection, the script collection is displayed in the VisualApplets GUI in the Script Collection pane.
Example
Three Script Collections TclExamples, LayoutAssist, and DesignTools are defined in their respective XML files.
XML files in the directory:
![]()
Directory for storing script collections as specified under Settings -> System Settings -> Paths:
![]()
Script collections as displayed in the GUI of VisualApplets:
![]()
|
Use Collection Name as File Name |
|
|
|
Make sure you use the same name for the XML file as you specify as collection name in the XML file in tag <ScriptCollection>. File name: Collection name within XML file: |
Syntax
The syntax of the XML file is the following:
The format is defined the in accordance to the following convention:
- Optional, individual elements are enclosed in square brackets [ ].
- Syntax elements that are allowed to be non-existent, to be there once or to be there multiple times, are enclosed in curly brackets { }.
- Syntax (..|..) indicates that one of the provided elements can be stated.
- Parameter values are stated in italic capital letters.
Annotations to Tags <Scope> and <Toolbar/>
<Scope>:
Optional tag, allowed only when you set
Command modetoTrigger. You can define<Scope>multiple times to specify multiple scopes. The tag is not allowed whenCommand modeis set toDragAndDrop.Use the tag
<Scope>if you want to define for which design elements the command (i.e., the underlying Tcl procedure) is to be carried out.
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.
<Toolbar/>:
Optional tag, allowed only when you set
Command modetoTrigger. If you include the tag, the commando is added to the toolbar of the collection. The tag is not allowed whenCommand modeis set toDragAndDrop.
Parameters
The parameters given above (in italic capital letters) you need to fill with the following content:
- COL_NAME: Name of collection
- COL_PNG_FILE_PATH: Path to icon file for collection (PNG format, for details see File Requirements). You need to specify the path relative to the XML file.
- COL_TOOLTIP_TEXT: Text displayed as tooltip information on the collection.
- CMD_NAME: Name of command.
- CMD_TOOLTIP_TEXT: Text displayed as tooltip information on the command.
- CMD_VERSION: Command version in format MAJOR.MINOR (for example,
1.0) - TCL_FILE_PATH: Path to the Tcl script that contains the procedure you want to be called by the command. Specify the path relative to the XML file.
- CMD_PNG_FILE_PATH: Icon file for the command (PNG format, for details see File Requirements). Specify the path relative to the XML file.
- CMD_CALL: Name of procedure within the Tcl script (or whole Tcl procedure) that is to be called by the command
- CMD_PARAM: Parameter names (arguments) to be substituted by actual values at command call. Only specify parameter names that are defined in the following <Parameter> tags.
- PAR_NAME: Parameter name
- PAR_RANGE_FROM: Start of value range (only for data types int or double)
- PAR_RANGE_TO: End of value range (only for data types int or double)
- PAR_RANGE_INC: Step size within the value range (only for data types int or double)
- PAR_VALUE: Default value for parameter
|
|
To display your changes without restarting VisualApplets, right-click into the Script Collection pane and select Rescan Script Collection Directory. |
Example