谢谢版主,试了一下不行!还请你再次给予指示! 谢谢! Public Sub BuildFilter(typeArray, dataArray, ParamArray gCodes()) '建立过滤代码子程序 Dim ftype() As Integer, fdata() '用数组方式填充一对变量作为选择集过滤器使用 Dim index As Long, i As Long index = LBound(gCodes) - 1 For i = LBound(gCodes) To UBound(gCodes) Step 2 index = index + 1 ReDim Preserve ftype(0 To index) ReDim Preserve fdata(0 To index) ftype(index) = CInt(gCodes(i)) fdata(index) = gCodes(i + 1) Next typeArray = ftype: dataArray = fdata End Sub Sub bb() On Error Resume Next Dim SS As AcadSelectionSet ThisDrawing.SelectionSets("Test").Delete Set SS = ThisDrawing.SelectionSets.Add("Test") Dim ftype, fdata BuildFilter ftype, fdata, 0, "*Text", 1, "~*[~.0-9]*", 1, "~*.*.*" SS.SelectOnScreen ftype, fdata MsgBox SS.Count End Sub 症状:一个数字都选择不了! |