Welcome to the RAS Solution Forums HECRAS Controller New User have a little problem on the RASController

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8193
    Anonymous
    Guest

    Hi guys,
    I am a new user on RASController. I was doing the MonteCarlo Experiment and the following is my code.

    Sub montecarloNvalues()

    Dim timestarttime As Variant, timenowtime As Variant, timelapsetime As Variant
    timestarttime = Timer

    Dim sngMeanN As Single, sngStdDev As Single
    sngMeanN = 0.04 ‘mean 0.04
    sngStdDev = 0.015

    Dim RC As New RAS503.HECRASController

    Dim strRasProj As String ‘HEC-RAS project
    Dim sngWSElev() As Single
    strRasProj = “C:\Users\Administrator\Documents\HEC Data\HEC-RAS\Example Projects\Applications Guide\Chapter 1 – Critical Creek\” & “CRITCREK.prj”
    RC.Project_Open (strRasProj)

    Dim typegeom As typerasgeom

    ……….
    When I try to run this code in VBA, the compiler said that the User-defined type not defined with “Dim typegeom As typerasgeom” highlighted.
    Could any one give me any help on this?
    Thanks!!
    Wii

    #13537
    Chris G.
    Keymaster

    TypeRASGeom is a class of variables that you have to set up. You can paste the following at the top of your module:

    Type TypeNode
    RiverStation As String
    NodeID As Long
    NodeType As String
    nProf As Long
    ProfName() As String
    Stage() As Single
    Flow() As Single
    StageInitial As Double
    StageAtTarget As Double
    TimeInitial As String
    TimeAtTarget As String
    End Type

    Type TypeRch
    nNode As Long
    Node() As TypeNode
    RchName As String
    RchID As Long
    End Type

    Type TypeRiv ‘River Type
    nRch As Long
    Rch() As TypeRch
    RivName As String
    RivID As Long
    End Type

    Type TypeRASGeom ‘Ras Geometry Type
    nRiv As Long
    Riv() As TypeRiv
    End Type

    #13538
    Anonymous
    Guest

    I did what you
    suggested, but I got a compilation error:
    I have a spanish Visual Basic, the Error is
    sólo los tipos definidos por el usuario de módulos de objeto públicos se pueden pasar a funciones enlazadas en tiempo de ejecución o forzar desde un variant

    That I translated as

    It says that only the types defined by user of the public object modules can be passs through link functions in the execution time o force from a variant

    Will you please help me with that?

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