Station Example

Land Auto

Station Example

Examples:

l CrossSection (Civil Engineering Feature)

l CrossSectionBlock (Civil Engineering Feature)

l PVI (Civil Engineering Feature)

l Superelevation (Civil Engineering Feature)


Sub Example_Station_CrossSection()
    
    ' This example returns the station for the first cross section in the
    ' cross section collection for the first alignment in the collection.
    Dim aligns As AeccAlignments
    Dim align As AeccAlignment
    Dim xSect As AeccCrossSection
    Set aligns = AeccApplication.ActiveProject.Alignments
    Set align = aligns.Item(0)
    Set xSect = align.CrossSections.Item(0)
    
    ' Get the cross section station and format it
    Dim station As String
    station = aligns.DoubleToStaFormat(xSect.station)
    
    MsgBox "The station for the first cross section in the collection is: " & _
        station, vbInformation, "Station Example"
    
End Sub

Sub Example_Station_CrossSectionBlock()
    
    ' This example returns the station for the
    ' first alignment cross section in the collection.
    Dim aligns As AeccAlignments
    Dim alignXSects As AeccCrossSectionBlocks
    Dim alignXSect As AeccCrossSectionBlock
    Set aligns = AeccApplication.ActiveProject.Alignments
    Set alignXSects = AeccApplication.ActiveDocument.CrossSectionBlocks
    Set alignXSect = alignXSects.Item(0)
    
    ' Get the station for the first alignment cross section in the collection
    Dim station As String
    station = aligns.DoubleToStaFormat(alignXSect.station)
    
    MsgBox "The station for the first alignment cross section in the collection is: " &  _
        station, vbInformation, "Station Example"
    
End Sub

Sub Example_Station_PVI()
    
    ' This example returns the Station value for the second PVI in the
    ' first finished ground of the first alignment in the collection.
    Dim align As AeccAlignment
    Dim FGProf As AeccFGProfile
    Dim PVI As AeccPVI
    Set align = AeccApplication.ActiveProject.Alignments.Item(0)
    Set FGProf = align.FGProfiles.Item(0)
    Set PVI = FGProf.PVIs.Item(1)
    
    MsgBox "The Station of the second PVI is: " _
        & Format(PVI.Station, "0.000"), vbInformation, "Station Example"
    
End Sub

Sub Example_Station_Superelevation()
    
    ' 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, "Station Example"
    
End Sub