Dim SS1 As AcadSelectionSet
Dim mode As Integer
Dim FilterType(0) As Integer
Dim FilterData(0) As Variant
FilterType(0) = 0 '按类型选择
FilterData(0) = "TEXT" '选择TEXT
On Error GoTo ErrorHandle '错误处理,出错时跳转到最后删除选择集
Set SS1 = acadDoc.SelectionSets.Add("selectset1") '添加空选择集
SS1.SelectOnScreen FilterType, FilterData '用屏幕选择方法,向选择集添加对象
'-----------------------------------------------------------改为绿色
Open "zuobiao.txt" For Append As #1
ReDim Ents(SS1.Count) As String
For i = 0 To SS1.Count - 1