Ruby Script

Running a Ruby script can help automate the editing of a network in InfoAsset Manager.

You can use the Ruby script editor to view and edit a Ruby script, to validate its syntax and to run the script in a network.

Tip: You can use the require_relative command to reference other Ruby scripts in the same Asset group in a single Ruby script. When you run the Ruby script, all referenced scripts are also run.

See Working with Database Items for details about creating, opening, importing and exporting a Ruby script and other relevant database item functions, and Introduction to Ruby Scripting in InfoWorks for general information about Ruby scripting in InfoAsset Manager.

Running Ruby scripts

Ruby scripts can be run in the current network in the GeoPlan by:

All Ruby scripts in the same Asset group, are automatically exported to your local working folder as RB files when a script is run.

If the Ruby script is run successfully, a Script output window is displayed, listing the changes that have been applied. An example is shown below:

If it is not run successfully, a message is displayed, which indicates the likely error and the name of the folder the failed Ruby script file is exported to.

Tip: You can use the Edit menu's Undo option to revert any changes applied to the network from a Ruby script. If the changes were applied from multiple Ruby scripts or a single script that referenced other scripts, all changes are reverted.