MaxElevation Example

Land Auto

MaxElevation Example

Examples:

l CrossSection

l Surface


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

Sub Example_MaxElevation_Surface()
    
    ' This example returns the MaxElevation for the first surface in the collection.
    Dim surf As AeccSurface
    Set surf = AeccApplication.ActiveProject.Surfaces.Item(0)
    
    MsgBox "The MaxElevation for surface " & surf.Name & "  is: " & Format(surf.MaxElevation, "0.00"), _
        vbInformation, "MaxElevation Example"
    
End Sub