Running HEC-RAS from Visual Basic 6 and Excel VBA

HEC-RAS is free a software by the Hydrologic Engineering Center (HEC) at the US Army Corp of Engineers which allows you to perform one-dimensional steady flow, unsteady flow, sediment transport/mobile bed computations, and water temperature modeling. Recently I needed to run HEC-RAS from my custom software and interact with the data and results. An example use would be making batch HEC-RAS runs with different parameters. At the HEC-RAS web-site I could not find any information about running the software as a server or from the command line. Searching around I found the Italian site of RUWA Ltd. with a link to a utility named RasClient (available for download at the bottom of this page).

The RasClient utility cames with a Visual Basic 6 source code example, Excel demo file and a Word document. The document seems to be written by Mark Jensen who is, according to the HEC-RAS user manual, is the programmer of the user interface and graphics of HEC-RAS. So I guess the RasClient utility is by HEC. The document states that “HEC-RAS is compiled as a server application and can be called from another program that supports ActiveX“. The demo is a Visual Basic 6 program and shows how to:

  • Dimension a new HEC-RAS object
  • Load a specific project
  • Execute the computations
  • Plot Results
  • Export the computed results

hec-ras-in-vb6

The VB6 program interacts with the HEC-RAS application server via a HECRASController object which have many properties and method. Unfortunately I could not find the documentation for these option so a lot of trial and error there. Some HEC-RAS GUI screens may be called as well:

hec-ras-output1Download RasClient here (ZIP file ~62KB)

Tagged with: , , , ,
2 comments on “Running HEC-RAS from Visual Basic 6 and Excel VBA
  1. Charles Omona says:

    Do you have excell based software for sizing of the pumps and sloar pannels for solar powered water pumps basec on measured pump yields and pump supply heads?

    Please let me of any quick an simplest analytical method to handle the issue i question for costs calculations.

    Many thanks

    Charles

Leave a Reply to Charles Omona Cancel reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.