Sub Ch4_AddToASelectionSet() ' 创建新的选择集 Dim sset As AcadSelectionSet Set sset = ThisDrawing.SelectionSets.Add("SS1") '定义过滤器类型为图层 Dim gpcode(0) As Integer gpcode(0) = 8 '图层名为0图层 Dim datavalue(0) As Variant datavalue(0) = 0 '选择0图层上所有的实体,并高亮显示 sset.Select acSelectionSetAll, , , gpcode, datavalue sset.Highlight (True) End Sub