Streamlining InfoWorks ICM SWMM: Simple Statistics of Thousands of Network Parameters with Ruby Prompts (Edition 44)
Streamlining InfoWorks ICM: Simple Statistics of Thousands of Network Parameters with Ruby Prompts (Edition 44)

Streamlining InfoWorks ICM SWMM: Simple Statistics of Thousands of Network Parameters with Ruby Prompts (Edition 44)

Introduction

Streamline your InfoWorks ICM SWM workflow with the power of Ruby scripting! Tired of manually sifting through thousands of parameters in your InfoWorks ICM SWMM models? Discover how Ruby scripting can revolutionize your data export workflow, saving you hours and unlocking deeper analysis. In this article, part of a series from Editions 41 to 50, I’ll share how Ruby scripts can simplify the process by exporting selected parameters to CSV files with a prompt. In Edition 42, we focused on exporting SW conduit, pump, and simulation parameters, with scripts available on Innovyze GitHub. We added an enhanced update: a checkbox that generates a Ruby puts table, providing the count, max, min, mean, and standard deviation for all fields of selected elements, expanding on the SW Table field prompts first introduced in Edition 42. This is a companion newsletter to Edition 43 for HW Tables, in which HW stands for HydroWorks, the grandfather of ICM InfoWorks. SW tables are for SWMM, and SWMM is its own grandfather.

This statistical functionality is helpful, especially for those familiar with InfoSWMM (me), where such stats were easily accessible via a right mouse click in the InfoSWMM and InfoSewer DB tables. Here, we leverage Ruby to calculate the mean, max, count, and min for various InfoWorks ICM components, including nodes, links, pumps, orifices, weirs, and subcatchments. A discerning reader will notice that these metrics are precisely what’s needed to compare an ICM InfoWorks network to an ICM SWMM network, which you can now do using the 12 RB files shown in Editions 43 and 44. This update not only enhances efficiency but also bridges the gap between different modeling systems, offering a clearer path for comprehensive network analysis.

Why Use Ruby for ICM SWMM Data Export?

Ruby scripting in ICM, a feature I’ve been using since 2021, allows for precise control over data export. With 7299 InfoWorks and 3180 SWMM parameters available, Ruby lets you select exactly what you need, saving time and enabling advanced analysis. Autodesk Water’s improved help file documents all 10,000+ variables, making Ruby a powerful tool for ICM users. There are seven Ruby files described in this newsletter, and one Ruby file has an embedded LinkedIn article with more detail. All of the seven Ruby files also have a markdown file on GitHub with the extension .md

Accessing the Scripts on Innovyze GitHub All scripts, along with detailed markdown documentation, are available in the Innovyze GitHub repository under 01 InfoWorks ICM/01 Ruby/02 SWMM/0005 - Import Export of Data Tables. Explore over 500 Ruby examples to enhance your ICM workflows in the whole GitHub.

1/ Exporting Up to 64 SW Conduit Parameters to CSV with Ruby in InfoWorks ICM SWMM

This is an update for statistics from the Ruby files introduced in Edition 42. It has the same prompt for many SW Table fields, but there is now a check box to make a Ruby puts table of the count, max, min, mean, and standard deviation of all fields for the selected elements.

The Ruby file is called export_sw_conduit_data_to_csv .rb and has a detailed markdown (.md) file in the sub directory 01 InfoWorks ICM/01 Ruby/02 SWMM/0005 - Import Export of Data Tables on the Innovyze GitHub

Exporting Up to 64 SW Conduit Parameters to CSV with Ruby in InfoWorks ICM SWMM

2/ Exporting Up to 62 SW Node Parameters to CSV with Ruby in InfoWorks ICM SWMM

This is an update for statistics from the Ruby files introduced in Edition 42. It has the same prompt for many SW Table fields, but there is now a check box to make a Ruby puts table of the count, max, min, mean, and standard deviation of all fields for the selected elements.

The Ruby file is called export_sw_node_data_to_csv.rb and has a detailed markdown (.md) file in the sub directory 01 InfoWorks ICM/01 Ruby/02 SWMM/0005 - Import Export of Data Tables on the Innovyze GitHub

Exporting Up to 62 SW Node Parameters to CSV with Ruby in InfoWorks ICM SWMM

3/ Exporting Up to 81 SW Subcatchment Parameters to CSV with Ruby in InfoWorks ICM SWMM

This is an update for statistics from the Ruby files introduced in Edition 42. It has the same prompt for many SW Table fields, but there is now a check box to make a Ruby puts table of the count, max, min, mean, and standard deviation of all fields for the selected elements.

Ruby file is called export_sw_subcatchments_to_csv.rb and has a detailed markdown (.md) file in the sub directory 01 InfoWorks ICM/01 Ruby/02 SWMM/0005 - Import Export of Data Tables on the Innovyze GitHub

Exporting Up to 81 SW Subcatchment Parameters to CSV with Ruby in InfoWorks ICM SWMM

4/ Exporting Up to 41 SW Weir Parameters to CSV with Ruby in InfoWorks ICM SWMM

This is an update for statistics from the Ruby files introduced in Edition 42. It has the same prompt for many SW Table fields, but there is now a check box to make a Ruby puts table of the count, max, min, mean, and standard deviation of all fields for the selected elements.

The Ruby file is called ex;port_sw_weir_to_csv.rb and has a detailed markdown (.md) file in the sub directory 01 InfoWorks ICM/01 Ruby/02 SWMM/0005 - Import Export of Data Tables on the Innovyze GitHub

Exporting Up to 41 SW Weir Parameters to CSV with Ruby in InfoWorks ICM SWMM

5/ Exporting Up to 45 SW Orifice Parameters to CSV with Ruby in InfoWorks ICM SWMM

This is an update for statistics from the Ruby files introduced in Edition 42. It has the same prompt for many SW Table fields, but there is now a check box to make a Ruby puts table of the count, max, min, mean, and standard deviation of all fields for the selected elements.

The Ruby file is called export_sw_orifice_to_csv.rb and has a detailed markdown (.md) file in the subdirectory 01 InfoWorks ICM/01 Ruby/02 SWMM/0005 - Import Export of Data Tables on the Innovyze GitHub

Exporting Up to 45 SW Orifice Parameters to CSV with Ruby in InfoWorks ICM SWMM

6/ Exporting Up to 32 SW Pump Parameters to CSV with Ruby in InfoWorks ICM SWMM

This is an update for statistics from the Ruby files introduced in Edition 42. It has the same prompt for many SW Table fields, but there is now a check box to make a Ruby puts table of the count, max, min, mean, and standard deviation of all fields for the selected elements.

The Ruby file is called export_sw_pump_to_csv.rb and has a detailed markdown (.md) file in the sub directory 01 InfoWorks ICM/01 Ruby/02 SWMM/0005 - Import Export of Data Tables on the Innovyze GitHub

Exporting Up to 32 SW Pump Parameters to CSV with Ruby in InfoWorks ICM SWMM

Conclusion

These Ruby scripts provide a selective and efficient way to export ICM SWMM parameters, enabling better analysis and decision-making. Try them out and let me know how they work for you! Have you leveraged Ruby to conquer complex ICM tasks? What are your go-to scripts or biggest time-savers? Share your insights in the comments below or send me a direct message!

Narges Raeisi

💧 Water Science | 👷♀️ Water & Hydraulic Structures Engineer | ✒️ Hydraulic Engineering Researcher ⇩ C𝐥i𝐜k F𝐎L𝐋O𝐖 𝐛u𝐭t𝐨n f𝐨r t𝐡e l𝐚t𝐞s𝐭 𝐝e𝐯e𝐥o𝐩m𝐞n𝐭 𝐢n 𝐖𝐚𝐭er e𝐧g𝐢n𝐞e𝐫i𝐧g

2mo

This is a fantastic initiative, Robert!

Robert Dickinson

Autodesk Technologist, models ICM InfoWorks and SWMM Networks with Ruby, Python and AI Agents / 20 Years at Innovyze/Autodesk | 50 Years with EPASWMM

2mo

One clarifying comment: this is actually better than the InfoSewer and InfoSWMM stats, which you found by right-mouse-clicking on the DB Tables. Better in that you can see the stats for ALL elements and not just one element at a time. I probably should update this to also have more of the InfoSWMM Stats which looked like this:

  • No alternative text description for this image
Like
Reply
Robert Dickinson

Autodesk Technologist, models ICM InfoWorks and SWMM Networks with Ruby, Python and AI Agents / 20 Years at Innovyze/Autodesk | 50 Years with EPASWMM

2mo

Editions 41 to 44 showcase a collection of 12 Ruby scripts, available on the Innovyze GitHub repository (Innovyze/Open-Source-Support), designed to export selected data from ICM SWMM or ICM InfoWorks networks to CSV files and calculate statistics for chosen parameters. This functionality replicates a valued feature from InfoSWMM and InfoSewer, enabling users to extract and analyze network data efficiently. The scripts cover key network components, including links, nodes, weirs, orifices, pumps, and subcatchments, for both HW (InfoWorks) and SW (SWMM) tables. Each script includes user-friendly prompts for selective data export and statistical computation, streamlining workflows for hydraulic and hydrologic modeling in InfoWorks ICM.

Like
Reply

To view or add a comment, sign in

Others also viewed

Explore topics