[VBA]求助:怎么选择集中的总数和实际总数对不上呢??
On Error Resume NextSet ssetObj = ThisDrawing.SelectionSets.Add("SSET_OBJ")
If Err Then
Err.Clear
Set ssetObj = ThisDrawing.SelectionSets("SSET_OBJ")
End If
' Add objects to a selection set by prompting user to select on the screen
' ssetObj.Clear
ssetObj.Clear
FilterType(0) = 0
FilterData(0) = "CIRCLE"
ssetObj.SelectOnScreen FilterType, FilterData
sngSum = ssetObj.Count
通过以上代码选中的16个圆,而sngSum却等于50??
可能你的<STRONG><U><FONT color=#f70909>圆有重复的,表面看到的是16,而实际存在的就是50个,你在检查一下</FONT></U></STRONG> Sub mm()
On Error Resume Next
Dim ssetObj As AcadSelectionSet
Set ssetObj = ThisDrawing.SelectionSets.Add("SSET_OBJ")
If Err Then
Err.Clear
Set ssetObj = ThisDrawing.SelectionSets("SSET_OBJ")
End If
On Error GoTo 0
' Add objects to a selection set by prompting user to select on the screen
' ssetObj.Clear
ssetObj.Clear
Dim FilterType(0)As Integer, FilterData(0)As Variant
FilterType(0) = 0
FilterData(0) = "CIRCLE"
ssetObj.SelectOnScreen FilterType, FilterData
sngSum = ssetObj.Count
End Sub
页:
[1]