HECRAS Controller in other language

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

HECRAS Controller in other language

kevin
I bought the book "breaking the hec-ras code" and really like the insights. Learnt a lot by following the examples in the book. For example, we can do the following in VBA:

    Dim lngNum_RS As Long
    Dim strRS() As String  'Name of the river reach
    Dim strNodeType() As String

    lngRiverID = 1
    lngReachID = 1
    RC.Geometry_GetNodes lngRiverID, lngReachID, lngNum_RS, strRS(), strNodeType()

The number of river reaches can be passed to the argument lngNum_RS. But in other languages (for example, python), this "passing by reference" mechanism might not work and with python, I can't get the number of river reaches in the same way.

I think my question is, what is the general rule to use this type of "passing by reference" functions in HECRAS Controller with python? Do we have a document for the HECRASController COM in python?

Thank you!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HECRAS Controller in other language

Chris G.
Administrator
Kevin-

I wish there was a document that covers some RASController coding strategies in python.  More and more people are using python with the RASController, so I know it can be done.  

One alternative way you might consider is to read your geometry directly from the geometry input file.  Chapter 4 of the book covers this topic and Appendix B has all of the geometry input file keys

Chris
Chris G.
@RASModel
www.therassolution.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HECRAS Controller in other language

kevin
Chris, thank you for your reply!

I totally agree. If someone starts a project to make python code for example cases and document them, many users would be interested in participating.

At this point, it would be very helpful if any experienced user could point out the general rule to call the functions (with return value in arguments by reference) in python. 

Thanks!

On Thu, Jul 27, 2017 at 6:50 AM, Chris G. [via HEC-RAS Help] <[hidden email]> wrote:
Kevin-

I wish there was a document that covers some RASController coding strategies in python.  More and more people are using python with the RASController, so I know it can be done.  

One alternative way you might consider is to read your geometry directly from the geometry input file.  Chapter 4 of the book covers this topic and Appendix B has all of the geometry input file keys

Chris
Chris G.
@RASModel
www.therassolution.com



If you reply to this email, your message will be added to the discussion below:
http://hec-ras-help.1091112.n5.nabble.com/HECRAS-Controller-in-other-language-tp4267p4276.html
To unsubscribe from HECRAS Controller in other language, click here.
NAML

Loading...