StationOffset Example

Land Auto

StationOffset Example

Sub Example_StationOffset()
    
    ' This example gets the StationOffset from user supplied point
    ' for the first Alignment in the collection..
    Dim align As AeccAlignment
    Set align = AeccApplication.ActiveProject.Alignments.Item(0)
    
    Dim returnPnt As Variant
    Dim station As Double
    Dim offset As Double
    Dim direction As Double
    
    ' Get the point
    returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point near the first alignment: ")
    
    ' Get the station offset location
    align.StationOffset returnPnt(0), returnPnt(1), station, offset, direction
    
    MsgBox "The StationOffset for the first Alignment is:" & vbCrLf & _
        "   Station: " & station & vbCrLf & _
        "   Offset: " & offset & vbCrLf & _
        "   Direction: " & direction, vbInformation, "StationOffset Example"
    
End Sub