0% found this document useful (0 votes)
797 views

PCSWMM Support: Articles

PSWMM ne Scripting

Uploaded by

mazzam75
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
797 views

PCSWMM Support: Articles

PSWMM ne Scripting

Uploaded by

mazzam75
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Scripting

PCSWMM Support

Articles

Back

Scripting

Creating, editing and executing scripts provide a powerful way to extend PCSWMM
functionality when working with model data, GIS layers, time series files and more.
PCSWMM's out-of-the-box support for IronPython (version 2.7.8) eliminates the need
for any additional configuration or setup after your PCSWMM installation. Scripts can be
created, managed and executed directly within the Script Editor, and scripting examples
are provided to get you started.
By providing direct access to all GIS, model and time series data, Python scripts in
PCSWMM can be used to accomplish virtually anything: from automating the model
development process and performing real-time flood forecasting, to supporting reading
from and writing to 3rd party file formats. You no longer have to wait for CHI to add
support for your needed processes.
Some example tasks that can be performed with scripting include:
editing SWMM and EPANET models input parameters

running SWMM and EPANET models

post-processing model results

reading/editing/writing/deriving time series files and data

creating/deleting/restructuring/editing vector layers, entities and attributes

performing GIS topological analysis (e.g. split, join, spatial query)

statistical analysis of time series or attribute data

interacting with the panels (e.g. select/deselect entities meeting user criteria on
the Map panel)

criteria-based notifications via text messages and/or emails (e.g. sending model
status upon completion of a long model run).
importing user-specific file formats (e.g. using csv IronPython library to work with
CSV files)

https://support.chiwater.com/124486/scripting[8/2/2020 12:26:23 PM]


Scripting

creating user interfaces (dialogs) for your scripts (e.g. using


System.Windows.Forms .NET framework assemblies)
uncertainty/sensitivity/optimization studies (e.g. using 3rd party .NET libraries such
as Accord.NET, and DLL libraries written in C)

and much more.

PCSWMM scripting inherits both the advantages and limitations of IronPython. All
libraries supported by IronPython may be used in PCSWMM's scripts. IronPython
currently does not support libraries with a C extension, such as numpy, scipy, and
matplotlib. However, similar functionalities may be found in .NET libraries, which are
supported.

Additional information
The links below provide details and references for scripting in PCSWMM. Additionally,
there are many Python scripting learning resources available online, including videos,
step-by-step tutorials, courses, examples and more.

Script Editor
Scripting class diagram
SWMM model classes
EPANET model classes
Generic classes
Scripting examples
Scripting tools
Scripting libraries
Script errors
Class property abbreviations

Can this article be improved?

Computational Hydraulics Int.


147 Wyndham St. N., Ste. 202
Guelph, Ontario, Canada, N1H 4E9

Copyright 2020 by CHI

https://support.chiwater.com/124486/scripting[8/2/2020 12:26:23 PM]


Scripting

https://support.chiwater.com/124486/scripting[8/2/2020 12:26:23 PM]

You might also like