下面是我在《VBA精彩实例教程》中的解决方法:
On Error Resume Next
Dim SSet As AcadSelectionSet
If Not IsNull(ThisDrawing.SelectionSets.Item("Example")) Then
Set SSet = ThisDrawing.SelectionSets.Item("Example")
SSet.Delete '及时删除不用的选择集非常重要
End If
Set SSet = ThisDrawing.SelectionSets.Add("Example")
在后面需要删除选择集的地方使用SSet.Delete即可。 |