Welcome to the RAS Solution Forums HECRAS Controller HECRAS Controller in other language

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8194
    Anonymous
    Guest

    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!

    #13539
    Chris G.
    Keymaster

    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

    #13540
    kevin
    Participant

    Return-Path:
    Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
    by sloti25t09 (Cyrus fastmail-fmjessie44509-15322-git-fastmail-15322) with LMTPA;
    Thu, 27 Jul 2017 16:54:03 -0400
    X-Cyrus-Session-Id: sloti25t09-957616-1501188843-2-1080895348803113679
    X-Sieve: CMU Sieve 3.0
    X-Spam-known-sender: no
    X-Spam-score: 0.0
    X-Spam-hits: BAYES_00 -1.9, FREEMAIL_FROM 0.001, HTML_MESSAGE 0.001,
    RCVD_IN_DNSWL_NONE -0.0001, RCVD_IN_MSPIKE_H3 -0.01,
    RCVD_IN_MSPIKE_WL -0.01, RCVD_IN_SORBS_SPAM 0.5, SPF_PASS -0.001,
    URI_HEX 1.122, LANGUAGES en, BAYES_USED global, SA_VERSION 3.4.0
    X-Spam-source: IP=’209.85.217.174′, Host=’mail-ua0-f174.google.com’, Country=’US’,
    FromHeader=’com’, MailFrom=’com’
    X-Spam-charsets: plain=’UTF-8′, html=’UTF-8′
    X-Resolved-to: [email protected]
    X-Delivered-to: [email protected]
    X-Mail-from: [email protected]
    Received: from mx4 ([10.202.2.203])
    by compute1.internal (LMTPProxy); Thu, 27 Jul 2017 16:54:03 -0400
    Received: from mx4.messagingengine.com (localhost [127.0.0.1])
    by mailmx.nyi.internal (Postfix) with ESMTP id B6907C86C5
    for ; Thu, 27 Jul 2017 16:54:02 -0400 (EDT)
    Received: from mx4.messagingengine.com (localhost [127.0.0.1])
    by mx4.messagingengine.com (Authentication Milter) with ESMTP
    id C967F381149;
    Thu, 27 Jul 2017 16:54:02 -0400
    Authentication-Results: mx4.messagingengine.com;
    dkim=pass (2048-bit rsa key) header.d=gmail.com [email protected] header.b=j3oUfGKy;
    dmarc=pass header.from=gmail.com;
    spf=pass [email protected] smtp.helo=mail-ua0-f174.google.com;
    x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net [email protected] header.b=oaXGZ517
    Received-SPF: pass
    (gmail.com … _spf.google.com: Sender is authorized to use ‘[email protected]’ in ‘mfrom’ identity (mechanism ‘include:_netblocks.google.com’ matched))
    receiver=mx4.messagingengine.com;
    identity=mailfrom;
    envelope-from=”[email protected]”;
    helo=mail-ua0-f174.google.com;
    client-ip=209.85.217.174
    Received: from mail-ua0-f174.google.com (mail-ua0-f174.google.com [209.85.217.174])
    (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
    (No client certificate requested)
    by mx4.messagingengine.com (Postfix) with ESMTPS
    for ; Thu, 27 Jul 2017 16:54:02 -0400 (EDT)
    Received: by mail-ua0-f174.google.com with SMTP id k43so113404356uaf.3
    for ; Thu, 27 Jul 2017 13:54:02 -0700 (PDT)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
    d=gmail.com; s=20161025;
    h=mime-version:in-reply-to:references:from:date:message-id:subject:to;
    bh=Ct5NqpMiMNcj8VwFxbTlVqvADWVae1xhBhoiZTXXNb4=;
    b=j3oUfGKyEDfFO+rEpUuvDWIbS8E2tjl7uv6xz+dit73eAnUZqDcEAQxbKf9S3mwPTr
    hS72O2oPFN+3QCky2deXuU84f3E/WcQdWco8B6FHjWl4BP/xdo49+b8XCLhgdPILK7IY
    IN5l+thYr9hF9SkJov2ukNlcupuLzXj6UPIrmv0jccm1UfFVhywO3l/h61fp8yKGOg8A
    DB1pl5ADw8aO7RuTdK2QQBTHIF71ZgUb567tfyo5govdl+Yjt6O1Bdl6o5XqdnEm9igs
    JVS3VztI9BoM7E5Ri7Q16+LPs9bW4v2pVsfpsm4ius0e0/ajOMjqcDGR4Ed6K8RXY5k2
    l+Hw==
    X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
    d=1e100.net; s=20161025;
    h=x-gm-message-state:mime-version:in-reply-to:references:from:date
    :message-id:subject:to;
    bh=Ct5NqpMiMNcj8VwFxbTlVqvADWVae1xhBhoiZTXXNb4=;
    b=oaXGZ517SOcWibw1PIOSZesZb6PYpWk7xbxKxD+qgf5KL1xA8rhDl0+hYQhQyjXS4a
    DzPnj/jSGotlBTGmrPnt2fkSiPB+TFhl0OlNLn1BhMnNzJmzA17EUxz0XnWeemZ5cT/j
    Y608Sw4enWoflDDGJ+KrNJWcqkFFvXQdVr2lzhpv5mBu2K9iwrZLLoxobeE79OUdTCei
    aMBh+pR4o+og2hS6yakY9MD0bo8laksPcOA16vZlxdIU/aBesJeFgEmLrl3r8yiZTUZC
    kQ0k8xE79meL2Sv1Xo6Mf2bnH7nDGoPvdbdGid+WLxtkVp5zaFFNN5729ahyJUletRTL
    M5wA==
    X-Gm-Message-State: AIVw113NgPYZbmT6c1LIYuZFX7YkuB56QO+ZtI7vx0Di9wnNDuQHjvMa
    rOoA46zthSt5OKFFdSIjxJCB+njkbA==
    X-Received: by 10.176.6.97 with SMTP id f88mr3857155uaf.22.1501188840988; Thu,
    27 Jul 2017 13:54:00 -0700 (PDT)
    MIME-Version: 1.0
    Received: by 10.31.25.15 with HTTP; Thu, 27 Jul 2017 13:54:00 -0700 (PDT)
    In-Reply-To: <[email protected]>
    References: <[email protected]> <[email protected]>
    From: Kevin Liu
    Date: Thu, 27 Jul 2017 13:54:00 -0700
    Message-ID:
    Subject: Re: HECRAS Controller in other language
    To: “Chris G. [via HEC-RAS Help]”
    Content-Type: multipart/alternative; boundary=”94eb2c12292e9ba6dd055552c37f”

    –94eb2c12292e9ba6dd055552c37f
    Content-Type: text/plain; charset=”UTF-8″
    Content-Transfer-Encoding: quoted-printable

    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] < [email protected]> 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 an=
    d
    > Appendix B has all of the geometry input file keys
    >
    > Chris
    > Chris G.
    > @RASModel
    > http://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
    > <http://hec-ras-help.1091112.n5.nabble.com/template/NamlServlet.jtp?macro=
    =3Dunsubscribe_by_code&node=3D4267&code=3DbGtmb3J3YXJkQGdtYWlsLmNvbXw0MjY3f=
    DQwNTY4NDY3Nw=3D=3D>
    > .
    > NAML
    > <http://hec-ras-help.1091112.n5.nabble.com/template/NamlServlet.jtp?macro=
    =3Dmacro_viewer&id=3Dinstant_html%21nabble%3Aemail.naml&base=3Dnabble.naml.=
    namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.v=
    iew.web.template.NodeNamespace&breadcrumbs=3Dnotify_subscribers%21nabble%3A=
    email.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble=
    %3Aemail.naml>
    >

    –94eb2c12292e9ba6dd055552c37f
    Content-Type: text/html; charset=”UTF-8″
    Content-Transfer-Encoding: quoted-printable

    Chris, thank you for your reply!

    I totally agree. If someone starts a project to make python code for exa=
    mple cases and document them, many users would be interested in participati=
    ng.

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

    Thanks!
    =

    On Thu, Jul=
    27, 2017 at 6:50 AM, Chris G. [via HEC-RAS Help] <ml+s109=
    [email protected]>
    wrote:

    ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le= ft:1ex">

    Kevin-

    I wish there was a document that covers some RASController coding s=
    trategies in python.=C2=A0 More and more people are using python with the R=
    ASController, so I know it can be done. =C2=A0

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

    Chris=20

    =09
    =09


    Chris G.

    @RASModel

    http://www.therass=
    olution.com

    If you reply to this email, your message =
    will be added to the discussion below:

    http://hec-ras-help.109=
    1112.n5.nabble.com/HECRAS-Controller-in-other-language-tp426=
    7p4276.html


    =09
    To unsubscribe from HECRAS Controller in other language, click here.
    NAML

    –94eb2c12292e9ba6dd055552c37f–

    #13541
    Anonymous
    Guest

    I am starting on C++ project to interact with HEC-RAS and so am interested in this forum and will probably purchase the “Breaking the HEC-RAS Code” book.
    However, I have found that you can look inside the ras.exe from within VisualStudio (menu view->object browser, then select Custom Component Set, click on the “…” button and find the HEC River Analysis System under the COM tab). From there you can see at least the functions and their parameters.

    Stay tuned as this project develops.

    #13542
    robgrhamsydney
    Participant

    Max,

    I am also interested in the C++ project to interact with HEC-RAS. Have you had any success?

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