ElevationAt Example

Land Auto

ElevationAt Example

Examples:

l EGProfile (Civil Engineering Feature)

l FGProfile (Civil Engineering Feature)


Sub Example_ElevationAt_EGProfile()
    
    ' This example uses ElevationAt to displays the elevation for a station,
    ' for the first existing ground profile in the first alignment in the collection.
    Dim align As AeccAlignment
    Dim EGProf As AeccEGProfile
    Set align = AeccApplication.ActiveProject.Alignments.Item(0)
    Set EGProf = align.EGProfiles.Item(0)
    
    Dim station As Double
    Dim elevation As Double
    
    'Get the station and the elevation
    station = ThisDrawing.Utility.GetReal("Enter a station: ")
    elevation = EGProf.ElevationAt(station)
    
    MsgBox "The elevation for station " & Format(station, "0.00") & " is: " _
        & Format(elevation, "0.00"), vbInformation, "ElevationAt Example"
End Sub

Sub Example_ElevationAt_FGProfile()
    
    ' This example uses ElevationAt to displays the elevation for a station,
    ' for the finished ground profile in the first alignment in the collection.
    Dim align As AeccAlignment
    Dim FGProf As AeccFGProfile
    Set align = AeccApplication.ActiveProject.Alignments.Item(0)
    Set FGProf = align.FGProfiles.Item(0)
    
    Dim station As Double
    Dim elevation As Double
    
    'Get the station and the elevation
    station = ThisDrawing.Utility.GetReal("Enter a station: ")
    elevation = FGProf.ElevationAt(station)
    
    MsgBox "The elevation for station " & Format(station, "0.00") & " is: " _
        & Format(elevation, "0.000"), vbInformation, "ElevationAt Example"
End Sub