AlignmentFromObjectID Example

Land Auto

AlignmentFromObjectID Example

Sub Example_AlignmentFromObjectID()
    
    ' This example returns the AlignmentFromObjectID for a selected alignment.
    Dim aligns As AeccAlignments
    Set aligns = AeccApplication.ActiveProject.Alignments
    
    Dim alignObj As AcadObject
    Dim basePnt As Variant
    Dim alignID As Long
    Dim alignNames As Variant
    
    On Error Resume Next
    
    ' The following example prompts for a selection from the user
     RETRY;:
    ThisDrawing.Utility.GetEntity alignObj, basePnt, "Select an object"
    
    If Err <> 0 Then
        Err.Clear
        MsgBox "Good Bye.", vbInformation, "AlignmentFromObjectID Example"
        Exit Sub
    Else
        alignID = alignObj.ObjectID
        alignNames = aligns.AlignmentFromObjectID(alignID)
        MsgBox "The selected alignment is named: " & alignNames(0), _
            vbInformation, "AlignmentFromObjectID Example"
    End If
    
    GoTo RETRY
    
End Sub