Sub Example_AddItems()
' 创建选择集
Dim ssetObj As AcadSelectionSet
Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SELECTIONSET")
' 将模型空间中的对象加入到对象数组中
Dim ssobjs() As AcadEntity
ReDim ssobjs(0 To ThisDrawing.ModelSpace.count - 1)
Dim I As Integer
For I = 0 To ThisDrawing.ModelSpace.count - 1
Set ssobjs(I) = ThisDrawing.ModelSpace.Item(I)
Next
' 将对象数组中的实体加入到选择集中
ssetObj.AddItems ssobjs
End Sub