AutoCAD VBA 通过选择集 删除图层上所有对象和图层
'删除图层上所有对象
FunctionDelAllInLayer(ByValLNameAsString)
'OnErrorResumeNext
DimSSetAsAcadSelectionSet
SetSSet=CreateSelectionSet("XXX")
DimFt(0)AsInteger,Fd(0)
Ft(0)=8:Fd(0)=LName
SSet.SelectacSelectionSetAll,,,Ft,Fd
DimEAsAcadEntity
MsgBoxSSet.Count
ForEachEInSSet
E.Delete
Next
EndFunction