Sub tt() On Error Resume Next Dim ss As AcadSelectionSet ThisDrawing.SelectionSets("TlsTest").Delete Set ss = ThisDrawing.SelectionSets.Add("TlsTest")
Dim ft(1) As Integer, fd(1) ft(0) = 0: fd(0) = "insert" ft(1) = 2: fd(1) = "AAA"
ss.Select acSelectionSetAll, , , ft, fd
Dim cblkref As AcadBlockReference Dim blkref As AcadBlockReference Dim arr Dim b As Boolean b = False Dim attref As AcadAttributeReference For Each blkref In ss arr = blkref.GetAttributes For Each attref In arr If attref.TagString = "XXX" Then If attref.TextString = "1" Then Set cblkref = blkref b = True Exit For End If If b Then Exit For End If Next attref Next blkref
Dim p1, p2 cblkref.GetBoundingBox p1, p2 Application.ZoomWindow p1, p2