AutoCAD VBA 通过选择集 删除图层上所有对象和图层
'删除图层上所有对象
Function DelAllInLayer(ByVal LName As String)
'On Error Resume Next
Dim SSet As AcadSelectionSet
Set SSet = CreateSelectionSet("XXX")
Dim Ft(0) As Integer, Fd(0)
Ft(0) = 8: Fd(0) = LName
SSet.Select acSelectionSetAll, , , Ft, Fd
Dim E As AcadEntity
MsgBox SSet.Count
For Each E In SSet
E.Delete
Next
End Function