Dim ss1 As AcadSelectionSet Dim layername As String Dim acadent As AcadEntity
'指定图层名称
layername = "MAIN"
'得到选择集
Dim gpCode(0) As Integer Dim dataValue(0) As Variant gpCode(0) = 8 dataValue(0) = layername
Set ss1 = ThisDrawing.SelectionSets.Add("ss3") ss1.Select acSelectionSetAll, , , gpCode, dataValue
For Each acadent In ss1 '对象处理 Next |