New User have a little problem on the RASController

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

New User have a little problem on the RASController

william
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
Reply | Threaded
Open this post in threaded view
|

Re: New User have a little problem on the RASController

Chris G.
Administrator
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
Chris G.
@RASModel
www.therassolution.com