Offset Example

Land Auto

Offset Example

Sub Example_Offset()
    
    ' This example returns the point code data for the first cross
    ' section surface in the collection for the first cross section
    ' in the collection.
    Dim aligns As AeccAlignments
    Dim align As AeccAlignment
    Dim xSect As AeccCrossSection
    Dim xSectPCode As AeccCrossSectionPointCode
    Set aligns = AeccApplication.ActiveProject.Alignments
    Set align = aligns.Item(0)
    Set xSect = align.CrossSections.Item(0)
    Set xSectPCode = xSect.CrossSectionPointCodes.Item(0)
    
    '  Get the alignment name
    Dim alignName As String
    alignName = align.Name
    
    ' Get the cross section station and format it
    Dim station As String
    station = aligns.DoubleToStaFormat(xSect.station)
    
    MsgBox "The alignment name is: " & alignName & vbCrLf & _
        "The first cross section is at station: " & station & vbCrLf & _
        "The data for the first point code is: " & vbCrLf & _
        vbTab & "Code: " & xSectPCode.Code & vbCrLf & _
        vbTab & "Description: " & xSectPCode.Description & vbCrLf & _
        vbTab & "Elevation: " & Format(xSectPCode.elevation, "0.00") & vbCrLf & _
        vbTab & "Offset: " & Format(xSectPCode.offset, "0.00"), _
        vbInformation, "Offset Example"
    
End Sub