ObjectID Example

Land Auto

ObjectID Example

Sub Example_ObjectID()
    
    ' This example returns the ObjectID value for the first Tangent found in the
    ' first Alignment in the collection.
    Dim align As AeccAlignment
    Dim alignEnts As AeccAlignEntity
    Set align = AeccApplication.ActiveProject.Alignments.Item(0)
    
    Dim alignMsg As String
    alignMsg = "There is no Tangent entitiy in the first Alignment."
    
    ' Find first Tangent in the alignment
    For Each alignEnt In align.AlignEntities
        If alignEnt.Type = kTangent Then
            alignMsg = "The ObjectID for the first Tangent in the alignment is: " & alignEnt.ObjectID
            Exit For
        End If
    Next
    
    MsgBox alignMsg, vbInformation, "ObjectID Example"
    
End Sub