Welcome to the RAS Solution Forums HEC-RAS Help Exporting x,y,z data from HEC-RAS to text file?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5402
    Shaina
    Participant

    Hi-

    Is there an easy way to get or infer the x,y,z (z being ground elevation) data of cross section geometries from the station, elevation information if the cross sections are geo-referenced in HEC-RAS?

    I know there is a way to import x,y,z geometry data into HEC-RAS from a .csv file …I basically want to go the other way and export x,y,z data into a text file.

    Thanks!
    ~Shaina

    #8639
    Anonymous
    Guest

    1. step: Geo-Referencing must be original and the interpolated cross sections!
    2. step: Run flow analysis!
    3. step: Use the pseudo code in Visual Basic! Input data will be “.geo” file.

    Do

    Do
    Loop Until Line Input = “Type RM Length L Ch R = 1”

    s = Input(Len(“XS GIS Cut Line=”), 1)
    Input #1, n

    Line Input #1, s
    X1 = Mid(s, 1,…): Y1 = Mid(s,…)
    For I = 3 To n Step 2
    Line Input #1, s
    Next
    X2 = Mid(s, …): Y2 = Mid(s, …)

    Line Input #1, NodeLastEditedTime

    Input #1, n
    ReDim l(1 To n), z(1 To n), X(1 To n), Y(1 To n)
    For I = 1 To n
    Input #1, l(I), z(I)
    Next I

    X1 = Val(X1): Y1 = Val(Y1): X2 = Val(X2): Y2 = Val(Y2)
    DL = l(n) – l(1)
    DX = X2 – X1
    DY = Y2 – Y1

    For I = 1 To n
    X(I) = X1 + (l(I) – l(1)) * DX / DL
    Y(I) = Y1 + (l(I) – l(1)) * DY / DL
    u = u + 1
    Print #2, u; vbTab; X(I); vbTab; Y(I); vbTab; z(I)
    Next I

    Good luck with the project!

    #8640
    mat A.
    Participant

    Hello,
    Thank you for your code!
    Can you explain for an inexperimented how to use the code in visual basic? whith witch software?
    Thank you in advance for your help.
    Mathieu.

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