为什么过滤选择,选择集内没有元素 Private Sub sellayer() On Error Resume Next Dim sset As AcadSelectionSet If Not IsNull(ThisDrawing.SelectionSets.Item("love")) Then Set sset = ThisDrawing.SelectionSets.Item("love") sset.Delete End If Set sset = ThisDrawing.SelectionSets.Add("love") Dim FilterType As Integer Dim Filterdata As Variant FilterType = 8 Filterdata = "AERTAL" sset.SelectOnScreen FilterType, Filterdata Dim element As AcadEntity For Each element In sset Debug.Print element.ObjectName, element.Layer Next sset.Delete End Sub |