我的代码如下:
Sub test05()
Dim Ent As AcadEntity
Dim SS As AcadSelectionSet
Set SS = PickFirstSSet
For Each Ent In SS
Ent.color = acYellow
Next
End Sub
Function PickFirstSSet() As AcadSelectionSet
On Error Resume Next
ThisDrawing.SelectionSets("PICKFIRST").Delete
Set PickFirstSSet = ThisDrawing.PickfirstSelectionSet
If PickFirstSSet.Count = 0 Then
PickFirstSSet.SelectOnScreen
End If
End Function