- Sub Ch4_AddToASelectionSet()
- ' 创建新的选择集
- Dim sset As AcadSelectionSet
- On Error Resume Next
- Set sset = ThisDrawing.SelectionSets("SS1")
- If Err Then
- Err.Clear
- Set sset = ThisDrawing.SelectionSets.Add("SS1")
- End If
- sset.clear
- ' 提示用户选择对象并将它们添加到选择集中。
- ' 要完成选择,按回车。
- sset.SelectOnScreen
- ' 在选择集中循环并将每一对象的颜色改为蓝色。
- Dim entry As AcadEntity
- For Each entry In sset
- entry.Color = acBlue
- entry.Update
- Next entry
- End Sub
|