LeaderExtension2 Example

AEC Auto

LeaderExtension2 Example

Sub Example_LeaderExtension2()

    'This example will find the 2nd Leader Extension for a bubble attached to a
    ' column grid
    
    Dim obj As AcadObject
    Dim bubble As AecMVBlockRef
    Dim anchor As AecAnchor
    Dim leaderAnchor As AecAnchorLeadEntToNode
    Dim pt As Variant
    
    ThisDrawing.Utility.GetEntity obj, pt, "Select bubble"
    If TypeOf obj Is AecMVBlockRef Then
        Set bubble = obj
        Set anchor = obj.GetAnchor
        If TypeOf anchor Is AecAnchorLeadEntToNode Then
            Set leaderAnchor = anchor
            MsgBox "Leader Extension2 = " & leaderAnchor.LeaderExtension2
        Else
            MsgBox "Not anchored to column grid", vbInformation, "Example LeaderExtension2"
        End If
    Else
        MsgBox "Not a bubble", vbInformation, "Example LeaderExtension2"
    End If

End Sub