login1986 发表于 2006-4-23 18:20:00

谁有删除层的涵数~

<P>谁有删除层的涵数~</P>
<P>不管层里有没有实体都能删除掉~</P>

freezl 发表于 2006-4-23 20:26:00

<P>肯定要分两部,先删掉图层上的实体,再删掉图层</P>

login1986 发表于 2006-4-24 09:14:00

那是當然了

<P>Set Sset = ThisDrawing.SelectionSets.Add("ss1" &amp; Time())</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; fType(0) = 0: fData(0) = "*"<BR>&nbsp;&nbsp;&nbsp;&nbsp; fType(1) = 8: fData(1) = LayerName<BR>&nbsp;&nbsp;&nbsp;&nbsp; FilterType = fType<BR>&nbsp;&nbsp;&nbsp;&nbsp; FilterData = fData</P>
<P><FONT color=#f73809>&nbsp;Sset.Select acSelectionSetAll, , , FilterType, FilterData</FONT><BR>&nbsp;&nbsp;&nbsp; For i = 0 To Sset.Count - 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sset(i).Delete<BR>&nbsp;&nbsp;&nbsp; Next i</P>
<P>哪位知道为什么为个老是出现错误啊...</P>
<P>老是在这句的时候出现错误...</P>
<P>Sset.Select acSelectionSetAll, , , FilterType, FilterData</P>
<P>但是在运行一次就好用了..<BR></P>

wyj7485 发表于 2006-4-24 14:26:00

<P>定义fType,fData有问题吧,应该如下:</P>
<P>Dim fType(1) As Integer<BR>Dim fData(1) As Variant</P>

login1986 发表于 2006-4-24 14:28:00

<P>我是这样定义的..</P>
<P>Dim FilterType As Variant<BR>Dim FilterData As Variant<BR>Dim fType(0 To 1) As Integer<BR>Dim fData(0 To 1) As Variant</P>

wyj7485 发表于 2006-4-24 14:44:00

<P>直接这样就可以啊</P>
<P>Dim fType(1) As Integer<BR>Dim fData(1) As Variant</P>
<P>Set Sset = ThisDrawing.SelectionSets.Add("ss1" &amp; Time())</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; fType(0) = 0: fData(0) = "*"<BR>&nbsp;&nbsp;&nbsp;&nbsp; fType(1) = 8: fData(1) = "0"<BR>&nbsp;&nbsp;&nbsp;&nbsp; </P>
<P>&nbsp;Sset.Select acSelectionSetAll, , , fType, fData<BR>&nbsp;&nbsp;&nbsp; For i = 0 To Sset.Count - 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sset(i).Delete<BR>&nbsp;&nbsp;&nbsp; Next i</P>

login1986 发表于 2006-4-25 09:12:00

<P>谢谢你了..我在试试吧...呵..</P>
<P>&nbsp;</P>
页: [1]
查看完整版本: 谁有删除层的涵数~