Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help Needed] Seeking guidance on understanding HECRASController API usage #9

Open
johnwick67943532 opened this issue Feb 6, 2025 · 2 comments

Comments

@johnwick67943532
Copy link

Key questions:

  1. Is there any official documentation for HECRASController API?
  2. For complex methods like Edit_QuasiUnsteadyFlowData(), how can we determine:
    • Required parameters
    • Expected data structures
    • Return values
    • Usage examples

Any guidance or documentation pointers would be greatly appreciated, as this would help others who are also working with the HEC-RAS automation interface.

I tried to to find out all possible api names,code above all possible apis like Edit_QuasiUnsteadyFlowData() :

import win32com.client

hec = win32com.client.Dispatch("RAS630.HECRASController")

attributes = dir(hec)

for attribute in attributes:
    if not attribute.startswith("_"):
        print(attribute)
@psuliuxf
Copy link
Collaborator

psuliuxf commented Feb 6, 2025

Unfortunately there is no official documentation for RASController and other APIs, despite years of advocacy to USACE HEC from the community. For simple APIs such as open project, run simulation, etc., it is easy to know how to use them. Others such as the one you mentioned, you will have to guess and try. In addition, HEC-RAS is a GUI-based app and not all operations are amenable to automation. The book from Chris Goodell might also have some more information, though it uses Excel VBA.

If you are to modify the unsteady flow data, another option for you is to directly modify the flow data file using Python script. Again, the problem is there is no documentation on the format of flow data files. You will have to guess again.

Good luck!

@johnwick67943532
Copy link
Author

Unfortunately there is no official documentation for RASController and other APIs, despite years of advocacy to USACE HEC from the community. For simple APIs such as open project, run simulation, etc., it is easy to know how to use them. Others such as the one you mentioned, you will have to guess and try. In addition, HEC-RAS is a GUI-based app and not all operations are amenable to automation. The book from Chris Goodell might also have some more information, though it uses Excel VBA.

If you are to modify the unsteady flow data, another option for you is to directly modify the flow data file using Python script. Again, the problem is there is no documentation on the format of flow data files. You will have to guess again.

Good luck!

OK then. if i got any clue to use LLM to guess some api and datastructure and successed. i will share it to community~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants