yuangw1234 发表于 2006-4-9 21:57:00

过滤选择的方法请教

<P><FONT color=#f76809>本人想请教一个只选择圆的方法,下面画绿线处就是</FONT></P>
<P><FONT color=#f76809>但运行出错,如大师明白为什么错,请多多指教</FONT></P>
<P>Public Sub c(layerr As String)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
<P>Dim ssetobj1 As AcadSelectionSet<BR>Dim icount1 As Integer<BR>icount1 = ThisDrawing.SelectionSets.Count<BR>While (icount1 &gt; 0)<BR>&nbsp;&nbsp;&nbsp; If ThisDrawing.SelectionSets.Item(icount1 - 1).Name = "yuan" Then<BR>&nbsp;&nbsp;&nbsp; ThisDrawing.SelectionSets.Item(icount1 - 1).Delete<BR>&nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp; icount1 = icount1 - 1<BR>&nbsp;&nbsp;&nbsp; Wend<BR>&nbsp;&nbsp;&nbsp; Set ssetobj1 = ThisDrawing.SelectionSets.Add("yuan")<BR>&nbsp;&nbsp;&nbsp; ThisDrawing.Utility.Prompt "please select object"</P>
<P>&nbsp;<FONT color=#dd4822>&nbsp;&nbsp;</FONT><FONT color=#09f709> dim filtertype as integer</FONT></P>
<P><FONT color=#09f709>&nbsp;&nbsp;&nbsp; dim filterdata as string</FONT></P>
<P><FONT color=#09f709>&nbsp;&nbsp;&nbsp; filtertype = 0</FONT></P>
<P><FONT color=#dd4822><FONT color=#09f709>&nbsp;&nbsp; filterdata=" circle "<BR>&nbsp;&nbsp;&nbsp; ssetobj1.SelectOnScreen filtertype,filterdata</FONT><BR></FONT>&nbsp; Dim i1 As Integer<BR>&nbsp; Dim selobj1 As Acadcircle<BR>&nbsp; For i1 = 0 To ssetobj1.Count - 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set selobj1 = ssetobj1.Item(i1)<BR>&nbsp;&nbsp;<BR>&nbsp; Next<BR>&nbsp; End Sub<BR></P>

subtlation 发表于 2006-4-10 00:11:00

<P><FONT color=#ff0000>参考一下下面的函数就知道了</FONT></P>
<P><FONT color=#09f709><A href="http://www.mccad.net/function/list.asp?id=288&amp;ordertype=byletter" target="_blank" >http://www.mccad.net/function/list.asp?id=288&amp;ordertype=byletter</A></FONT></P>

xinghesnak 发表于 2006-4-10 09:02:00

<P>过滤类型和数据要用数组,不是一个单一的字符串。。。。</P>
页: [1]
查看完整版本: 过滤选择的方法请教