AnsweredAssumed Answered

How to get the second entity attached to an annotation? (VBA)

Question asked by Nishihama Sayuri on Jul 27, 2017
Latest reply on Aug 7, 2017 by Nishihama Sayuri

I drew an annotation by pointing two entities on .slddrw file.

 

And I want to get second entity attached to the annotation using VBA.

2016 SOLIDWORKS API Help - Get Types of Entities Attached to Selected Annotation Example (VBA)

 

[GetAttachedEntities3] method returns entities, but entity order is at random.

How do I get the second entity?

---

vAttEntArr = swAnn.GetAttachedEntities3
vAttEntTypeArr = swAnn.GetAttachedEntityTypes2

If Not IsEmpty(vAttEntTypeArr) Then
    For i = 0 To UBound(vAttEntTypeArr)
         ' I want to get the second entity only. but entity order is at random.
         '  It is not always true "that i=1 entity is the second entity".
     Next i
End If

 

HELP me.

Outcomes