Creating Tools

You can create your own custom tools to contain actions that you create or copy from other tools. For example, you might want to create a new tool to contain the actions you use most often, or actions you create for a specific purpose. For more information on tools, see Choosing a Tool.

The following instructions lead you through the process of creating a new tool.

  1. To add a new tool, click the pull-down menu button at the top right of the Tool Palette.
    tool_add.jpg
  2. Select Edit Tools from the pull-down menu, as shown above.
  3. The Tool Palette displays the Cancel Edits, Accept Edits, and New Tool buttons.

tool_edit_main.gif

tool_add_icon_resize.gif

  1. Enter the information for your new tool. When the dialog information is correct, click OK.
  2. The new tool you just added appears in the tools list:

tool_added.gif

  1. Click Accept Edits.

Adding Actions to a Tool

You can add actions to system or custom tools. One way to add actions is Copying Actions to Tools. Another is adding custom actions that you define. The following instructions show an example custom action that uses an IDL procedure that is not an iTools command:

  1. Click on the action toggle (window_icon.gif) to expand the Tool Palette to display the action. (You can also drag the right border of the Tool Palette to the right to display the action.)
  2. To add a new action, click on a tool. (This example uses the custom "My Tools" tool created in Creating Tools.)
  3. Click the pull-down menu button at the top right of the Tool Palette.
    map_custom_action01jz.jpg
  4. Select Edit Actions from the pull-down menu, as shown above. The action area now appears with Cancel Edits and Accept Edits at the top and New Action below that.
    tool_new_action.gif
  5. Tip
    You can also use the pop-up context menu accessed from a tool to add a new action or edit and existing one.
    context_action.gif

  6. Click New Action. The Add New Action dialog appears.
  7. The following action definition uses the VELOVECT procedure:
    tool_velovect_action.gif

    The following table describes the action definition:

    Action Element
    Item
    Description

    IDL Procedure

    VELOVECT

    Calls the IDL VELOVECT procedure to display velocity vectors.

    Positional Arguments

    U, V

    Defines the data variables to use.

    Keywords

    MISSING=18

    Specifies that values greater than 18 are ignored.

    /DOTS

    Defines the missing values to be shown as dots.

    Title

    Velocity Vectors

    Title appears in the action by default.

    Description

    Produces a velocity vector plot showing values greater than 18 as dots

    Description appears on mouse hover over the action.

  8. Click OK.
  9. Click Accept Edits.
  10. The new action now appears under the My Tools Actions:

too_my_tool.gif

Now you can test the new action with some random data.

  1. Enter the following lines at the IDL command line:
  2. U = RANDOMN(S, 20, 20)

    V = RANDOMN(S, 20, 20)

    You will see three new variables in the Variables view (S, U, and V).

  3. Drag the U and V variables and drop them on the My Tools action.
  4. Click the VELOVECT button to visualize the data.

Copying Actions to Tools

You can easily move actions between tools. You might find this functionality most useful when creating a custom tool. For example, you could create a new tool that contains the actions that you need to use most often. Those actions could include a plot action, a surface action, a map action, and some custom actions. Start by copying the actions you use from other tools into your new tool. Then add the custom actions you need to the new tool.

The procedure for copying an action to a tool:

  1. Make sure you are viewing the IDL Visualize Perspective. (Click the Visualize button (viz_button.gif) in the upper right of the Workbench.)
  2. Click on the action toggle button (window_icon.gif) to expand the Tool Palette to display the action. (You can also drag the right border of the Tool Palette to the right to display the action.)
  3. Click on the tool that you want to copy from to display the associated actions.
  4. Click in the action you want to copy, and drag it to another tool. The following screen shot shows an example:
    action_drag.jpg
  5. Repeat for all the actions that you want in the tool.
  6. The following example shows a custom tool with several actions copied from existing tools:
    new_tool_actions.gif

    Tip
    To add custom actions to a tool, see Creating an Action.