请问如何删除指定名字图层上的所有对象
<p>如题</p><p> 各位大侠,代码怎么写?谢谢!</p> <font face="Verdana">Function DelAllInLayer(ByVal LName As String)<br/> 'On Error Resume Next<br/> Dim SSet As AcadSelectionSet<br/> Set SSet = CreateSelectionSet("XXX")<br/> Dim Ft(0) As Integer, Fd(0)<br/> Ft(0) = 8: Fd(0) = LName<br/> SSet.Select acSelectionSetAll, , , Ft, Fd<br/> Dim E As AcadEntity<br/> 'MsgBox SSet.Count<br/> For Each E In SSet<br/> E.delete<br/> Next<br/>End Function<br/>Function CreateSelectionSet(Optional SSetName As String = "mjtd") As AcadSelectionSet<br/> On Error Resume Next<br/> ThisDrawing.SelectionSets(SSetName).delete<br/> Set CreateSelectionSet = ThisDrawing.SelectionSets.Add(SSetName)<br/>End Function<br/>网上找到的,不知道怎么用。</font> <p>建立选择集-用选择集过滤器根据图层名称选择指定图层上所有对象-删除对象-删除选择集</p>
<p> </p>
<p>实际上你找到的程序已经足够清楚了,不知道怎么用说明你大概还没有入门。建议你再看看这方面的资料。明经里有很多入门学习资料,足够满足你的需要。</p>
页:
[1]