InfoWorks ICM Integration

From H2Know-how Manual

The InfoWorks ICM Integration module is designed to allow users the ability to move their models between InfoWorks and H2knOw-how. The module allows users to edit their model in InfoWorks or H2knOw-how and then synchronize the changes.

Concepts

Custom Actions

InfoWorks allows users to extend it's functionality through Ruby scripts installed as Custom Actions. This means that it's possible to write and install a Ruby script into InfoWorks that will do something that InfoWorks itself can't do. The InfoWorks Integration module uses this capability to synchronize data with H2knOw-how.

Synchronizing

The InfoWorks Integration module synchronizes InfoWorks and H2knOw-how through two actions, Imports and Exports.

An Import will take a model from H2knOw-how and insert it into InfoWorks. If your InfoWorks model is empty then the data will be added, if your model is not empty then your model will be updated. This can take some time depending on the size of your model.

An Export will save your model to a file and send this file to H2knOw-how where it will be saved and processed. An export will insert new assets and update existing ones. Additionally if you delete an asset from InfoWorks then it will be removed in H2knOw-how.

It is recommended that Exports and Imports are performed in tandem to ensure both sides are synchronized.

How to add the script

Overview

This section describes how to install a ruby script as a Custom Action. This process needs to be performed for each model file because the custom actions are saved to models individually. To get started in this section you will need InfoWorks CM and the H2KLink.rb file.

Adding a Custom Action

Open up InfoWorks and select a model to work with. Next click on the File menu, click on Master database settings.

    UserCustomActions.png

A User Custom Actions dialog should open.

    UserCustomActions dialog.png

Here you can create a new Custom Action or modify an existing one. To add a new action click on the box next to Custom Action and select an unused item. Next give a name to the action and a brief description. Under 'or select a Ruby script to be run:' click the button on the right with the '...' symbol.

H2K tool open dialog box.PNG

Paste the following hyperlink https://www.h2knowhow.com/Resources/Integration/h2k-infoworks-init.rb under 'File name:' and then click the Open button. This will save the latest online version of the script so it can be added to InfoWorks.

Exporting result files

Go to 'Results -> Export to Files', drag the simulation results onto the 'Sim', toggle on the '.PRN' file type and select the location of your results files to be imported into H2KnowHow.

NOTE: When running FEH rainfalls make sure to run 'Summer' and 'Winter' rainfalls separately. Otherwise Infoworks gives them the same name and will overwrite them when saving.

Export PRN results.PNG

How to use the script

To start the script click on the Actions menu and then on the script, it's name will depend on how it was set up.

Run tool box.png

A window will appear that will ask for an API Key and an action. The API Key acts as a user name and password and will give access to different projects. Type in the key and choose an action.

Import will take the model on H2knOw-how and insert it's data into InfoWorks, Export will do the opposite. Export PRN will ask for a folder and will upload any PRN files inside and insert their data into H2knOw-how. Select an action and click OK.

Script dialog box 1.png

Next a window will appear asking for a project, select the project you want to work with from the list and click OK. Next select the scenario you want to work with and click OK.

You will be asked to confirm and then the selected action will be performed.