Dim n As Integer
n = ThisDrawing.SelectionSets.Count
While (n > 0)
If ThisDrawing.SelectionSets.Item(n - 1).Name = "aaa" Then
ThisDrawing.SelectionSets.Item(n - 1).Delete
n = n - 1
End If
Wend
Dim aa As AcadSelectionSet
Set longSelectionSet = ThisDrawing.SelectionSets.Add("aaa")
longSelectionSet.SelectOnScreen
End Sub第二种方法: Sub a()
On Error Resume Next
Dim longSelectionSet As AcadSelectionSet
ThisDrawing.SelectionSets("aaa").Delete
If Error Then
Err.Clear
End If
Set longSelectionSet = ThisDrawing.SelectionSets.Add("aaa")
longSelectionSet.SelectOnScreen
End Sub 明经函数里有创建空的选择集的函数 已经有出错处理 你可以看看
页:
[1]