Closing HEC-RAS after each run using python

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Closing HEC-RAS after each run using python

sumisj06
Hi Chris
I am using python to automate HEC-RAS in real-time. I need to run it every 6 hours. I made it to run after every 6 hours interval. But the problem is that HEC-RAS shows a dialogue box after every run asking "Do you want to save the project". I need to manually click on the "Yes / No" button to save the project and begin the next one with new dataset. What can I do so that it just finishes one run, saves it and goes to the next run?
Reply | Threaded
Open this post in threaded view
|

Re: Closing HEC-RAS after each run using python

Solomon Vimal
In the meanwhile, you can use a simple hack like automating the mouse. You can use the code below to click on the window that pops up every-time. Because it comes up in the same location.

import win32api, win32con
def click(x,y):
    win32api.SetCursorPos((x,y))
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
click(10,10)
Reply | Threaded
Open this post in threaded view
|

Re: Closing HEC-RAS after each run using python

sumisj06
Thanks Solomon Vimal. I will try this process.
Reply | Threaded
Open this post in threaded view
|

Re: Closing HEC-RAS after each run using python

lokendra.dixit@rmsi.com
In reply to this post by sumisj06
HI,

Can you share the process to run HEC RAS by using Python and export  the maps of  (Depth, Velocity, ecc.)
With Regards
Lokendra