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.
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) 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:
- Navigate to the folder used by your application data.
The folder location can be found in the NEP (iws) Folder entry in Additional Information section of the About box window.
For example: C:\Users\User_One\AppData\Roaming\Innovyze\WorkgroupClient
- In this folder, add a new sub-folder called scripts, for example, C:\Users\User_One\AppData\Roaming\Innovyze\WorkgroupClient\scripts
- In the scripts folder, create a CSV file called scripts.csv.
- 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 (i.e. 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.
NoteChanges to this file only take effect when the application is restarted.
- Restart InfoWorks ICM.
- Open the network for which you want to run the add-on.
- Select the Run add-on option from the Network menu, and choose the applicable add-on from the list.
InfoWorks ICM now runs the applicable Ruby script.