MaxOffset Example

Land Auto

MaxOffset Example

Sub Example_MaxOffset()
    
    ' This example returns the maximum offset 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 maximum offset for the cross section at station " & station & " is: " & _
        Format(xSect.MaxOffset, "0.00"), vbInformation, "MaxOffset Example"
    
End Sub