Welcome to the RAS Solution Forums HECRAS Controller Closing HEC-RAS after each run using python

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8198
    sumisj06
    Participant

    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?

    #13554
    Anonymous
    Guest

    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)

    #13555
    sumisj06
    Participant

    Thanks Solomon Vimal. I will try this process.

    #13556
    [email protected]
    Participant

    HI,

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.