StationElevationToXy Example

Land Auto

StationElevationToXy Example

Sub Example_StationElevationToXy()
    
    ' This example returns the StationElevationToXy for the first ProfileBlock
    ' in the collection.
    Dim alignProf As AeccProfileBlock
    Set alignProf = AeccApplication.ActiveDocument.ProfileBlocks.Item(0)
    
    Dim StaElev(0 To 1) As Double
    Dim XY As Variant
    Dim station As Double
    Dim elevation As Double
    
    'Get the station and the elevation
    station = ThisDrawing.Utility.GetReal("Enter the station for the X value: ")
    elevation = ThisDrawing.Utility.GetReal("Enter the elevation for the Y value: ")
    
    ' Use the entered values to get the X and Y values
    staElev(0) = station
    staElev(1) = elevation
    
    XY = alignProf.StationElevationToXy(staElev)
    
    MsgBox "The X value for the StationElevation is: " & Format(XY(0), "0.00") & vbCrLf & _
        "The Y value for the StationElevation is: " & Format(XY(1), "0.00") _
        , vbInformation, "StationElevationToXy Example"
    
End Sub