create_gui_custom_command - 2024.2 English

Vivado Design Suite Tcl Command Reference Guide (UG835)

Document ID
UG835
Release Date
2024-11-13
Version
2024.2 English

Create a custom command in the GUI

Syntax

create_gui_custom_command ‑name <arg> [‑menu_name <arg>]
    [‑description <arg>] [‑show_on_toolbar] [‑run_proc <arg>]
    [‑toolbar_icon <arg>] [‑command <arg>] [‑tcl_file <arg>] [‑quiet]
    [‑verbose]

Usage

Name Description
-name Unique name of the command to create.
[-menu_name] Menu name for the custom command.
[-description] Display this text for the description of the menu item and optionally the toolbar button
[-show_on_toolbar] Add this command to the toolbar
[-run_proc] Needed when '-command' and 'tcl_file' options are both specified. If true, gui button will run command mentioned in '-command' option otherwise source script mentioned in '-tcl_file' option
[-toolbar_icon] The full path to the PNG or JPEG file to display on the toolbar button
[-command] The command to execute
[-tcl_file] The full path to the Tcl file to source
[-quiet] Ignore command errors
[-verbose] Suspend message limits during command execution

Categories

GUIControl

Description

This command creates a GUI menu item for a user custom command. The menu command appears in the Tools > Custom Commands menu in the Vivado™ IDE.

The custom GUI command can also be shown/hidden on the toolbar menu. When the GUI button is clicked the custom command is executed. A Tcl file can also be sourced when the GUI button is clicked.

You can use get_gui_custom_commands to determine the list of user-defined custom commands.

Arguments

-name - (Required) Unique name of the command to create.

-menu_name - (Optional) Menu name for the custom command.

-description - (Optional) Display this text for the description of the menu item and optionally the toolbar button

-show_on_toolbar - (Optional) Add this command to the toolbar

-run_proc - (Optional) Needed when both -command and -tcl_file options are specified. If TRUE, the menu command will run the specified -command, otherwise source the Tcl script specified by -tcl_file.

-toolbar_icon - (Optional) The full path to the PNG or JPEG file to display on the toolbar button

-command - (Optional) The command to be executed.

-tcl_file - (Optional) The full path to the Tcl file to source.

-quiet - (Optional) Execute the command quietly, returning no messages from the command. The command also returns TCL_OK regardless of any errors encountered during execution.
Note: Any errors encountered on the command-line, while launching the command, will be returned. Only errors occurring inside the command will be trapped.
-verbose - (Optional) Temporarily override any message limits and return all messages from this command.
Note: Message limits can be defined with the set_msg_config command.

Examples

The following example creates a GUI custom command with name 'print_version', and adds it to the toolbar.

create_gui_custom_command -name print_version -command "version" \
-description "Gets tool version" -show_on_toolbar