

SngWS(i) = RC.Output_NodeOutput(lngRiverID, lngReachID, i, 0, 3, lngWS_ID) Sub HECRASController1()ĭim sngWS() As Single 'Array of water surface elevations Next, write a for loop that will get data for each cross section. RAS IDįlow Area of the entire cross section including ineffective flowįroude number for the entire cross sectionįriction slope between two cross sections The table below lists some variables available in HEC-RAS and their associated IDs. There are 268 HEC-RAS variables available in the HEC-RAS Controller.

This involves declaring a single array for water surface elevations (or whatever you are retrieving), re-dimensioning the array to the number of river stations, and declaring the appropriate RAS ID. Although we got the river stations and node types in the previous step, some variables still need to be declared to obtain output. Thirdly, we will write the code that retrieves the output data. RC.Geometry_GetNodes lngRiverID, lngReachID, lngNum_RS, strRS(), strNodeType() LngReachID = 1 'Hard-coded Reach ID since there is only oneĭim strRS() As String 'Array of name of nodes LngRiverID = 1 'Hard-coded River ID since there is only one RC.Compute_CurrentPlan lngMessages, strMessages()ĭim lngRiverID As Long, lngReachID As Long 'River ID and Reach ID Sub HECRASController1()ĭim lngMessages As Long 'Number of messages returnedĭim strMessages() As String 'String of messages returned Secondly, we will use the Geometry_GetNodes subroutine to obtain the geometry information before retrieving output data. StrRASProject = "C:\filepath\RAS Model\Baxter.prj"

This will literally show HEC-RAS while the program is running. To open HEC-RAS, use the ShowRas subroutine. The Project_Open subroutine starts the HEC-RAS software in the background. Next, open the HEC-RAS project in the background using the Project_Open subroutine. This is a fancy way of saying creating an occurrence of the HEC-RAS Controller class. Then instantiate a new HECRASController class. First pull up Excel VBA by clickicking Alt+F11. Now it is time to start writing our program. RAS Model Download Open the Model in HEC-RAS
