Public Sub ss()
obj_Doc = obj_Acad.ActiveDocument
On Error GoTo err1
Dim objEntArr() As Object, i As Long
Dim objSset As AutoCAD.AcadSelectionSet
SelectAllText(objSset)
ReDim objEntArr(objSset.Count - 1)
For i = 0 To objSset.Count - 1
objEntArr(i) = objSset.Item(i)
Next i
XY_Sort(objEntArr)
For i = 0 To UBound(objEntArr)
objEntArr(i).TextString = objEntArr(i).TextString & CStr(i + 1)
Next i
Exit Sub
err1:
Err.Clear()
Debug.Print(Err.Description)
End Sub