SuperelevationCode Example

Land Auto

SuperelevationCode Example

Sub Example_SuperelevationCode()
    
    ' This example returns the data for the first superelevation in the
    ' superelevation collection for the first alignment in the collection.
    Dim aligns As AeccAlignments
    Dim align As AeccAlignment
    Dim sElev As AeccSuperelevation
    Set aligns = AeccApplication.ActiveProject.Alignments
    Set align = AeccApplication.ActiveProject.Alignments.Item(0)
    Set sElev = align.Superelevations.Item(0)
    
    '  Get the alignment name
    Dim alignName As String
    alignName = align.Name
    
    ' Get the superelevation station and format it
    Dim station As String
    station = aligns.DoubleToStaFormat(sElev.station)
    
    ' Get the superelevation curve code
    Dim crvCode As String
    Select Case sElev.curveCode
    Case kSERightHandCurve
        crvCode = "Right Hand Curve"
    Case kSELeftHandCurve
        crvCode = "Left Hand Curve"
    End Select
    
    ' Get the superelevation code
    Dim supCode As String
    Select Case sElev.SuperelevationCode
    Case kSEFullCrown
        supCode = "Full Crown"
    Case kSEHalfCrown
        supCode = "Half Crown"
    Case kSECrownRemoved
        supCode = "Crown Removed"
    Case kSEFullSuperelevations
        supCode = "Full Superelevation"
    Case kSEReverseCurve
        supCode = "Reverse Curve"
    Case kSECompoundCurve
        supCode = "Compound Curve"
    End Select
    
    MsgBox "The alignment name is: " & alignName & vbCrLf & _
        "The data for the first superelevation is: " & vbCrLf & _
        vbTab & "Station: " & station & vbCrLf & _
        vbTab & "Curve Code: " & crvCode & vbCrLf & _
        vbTab & "Superelevation Code: " & supCode, _
        vbInformation, "SuperelevationCode Example"
    
End Sub