Running Add-ons

An add-on can be run using the Run add-on option in the Network menu.

An add-on allows a user, usually an administrator, to set up Ruby scripts to perform various tasks that may be performed on a regular basis, and to associate each script with a menu item.

For example, a script could be written that specifies the import information when importing data from an external data source.

Note: Scripts are an advanced feature and not recommended for anyone without experience of programming in a scripting language.

The add-ons must be defined in a CSV file called scripts.csv that consists of two columns. The first column must contain the name of the add-on (this will appear as a menu item in the Run add-on option on the Network menu) and the second must contain the path for the script file itself (see Step 4 of the following procedure for further information). Only one Ruby script can be associated with each menu item.

The scripts.csv file must be located in a sub-folder (called scripts) of the folder used by your application data. If this has already been set up, then a list of add-on options will appear when the Network | Run add-on option is selected, from which you can select the appropriate one.

To set up and run an add-on:

  1. Navigate to the folder used by your application data.

    The folder location can be found in the NEP (iws) Folder entry of the About box window.

    For example: C:\Users\User_One\AppData\Roaming\Innovyze\WorkgroupClient

  2. In this folder, add a new sub-folder called scripts, for example, C:\Users\User_One\AppData\Roaming\Innovyze\WorkgroupClient\scripts
  3. In the scripts folder, create a CSV file called scripts.csv.
  4. Ensure that the scripts.csv file contains two columns; the first column must contain the name that is to be used to identify the Ruby script (this will appear as a menu item in the Run add-on option) whilst the second must contain the path for the script file itself.

    The script file paths may either be fully qualified paths (that is, beginning with a drive letter or the name of a network share) in which case that path will be used, or a non-fully qualified path in which case the software will assume the file is in the folder containing the CSV file or a subdirectory of it.

    Note: Changes to this file only take effect when the application is restarted.

  5. Restart InfoWorks WS Pro.
  6. Open the network for which you want to run the add-on.
  7. Select the Run add-on option from the Network menu, and choose the applicable add-on from the list.

    InfoWorks WS Pro now runs the applicable Ruby script.

Network menu