dfgs 发表于 2005-11-9 14:57:00

请教选择的问题

<P>以下代码:</P>
<P>&nbsp;&nbsp; Dim P1(0 To 2), P2(0 To 2) As Double<BR>&nbsp;&nbsp; P1(0) = -50:&nbsp;&nbsp; P1(1) = -50:&nbsp;&nbsp; P1(2) = 0<BR>&nbsp;&nbsp; P2(0) = 50:&nbsp;&nbsp; P2(1) = 50:&nbsp;&nbsp; P2(2) = 0<BR>&nbsp;&nbsp; UserForm1.Hide<BR>&nbsp;&nbsp; Dim ss As AcadSelectionSet<BR>&nbsp;&nbsp; On Error Resume Next&nbsp; <BR>&nbsp;&nbsp; Set ss = ThisDrawing.SelectionSets("pline")&nbsp; <BR>&nbsp;&nbsp; If Err Then Set ss = ThisDrawing.SelectionSets.Add("pline")&nbsp;&nbsp;<BR>&nbsp;&nbsp; ss.Clear&nbsp;<BR>&nbsp;&nbsp;&nbsp;ss.SelectOnScreen<BR>&nbsp;&nbsp; Dim entry As AcadEntity<BR>&nbsp;&nbsp; For Each entry In ss<BR>&nbsp;&nbsp;&nbsp;&nbsp; entry.Color = acBlue<BR>&nbsp;&nbsp;&nbsp;&nbsp; entry.Update<BR>&nbsp;&nbsp; Next entry</P>
<P><BR>上面的代码是可以正常执行的,但是我将ss.SelectOnScreen改为ss.Select acSelectionSetCrossing, P1, P2 并在P1、P2的矩形框区内画了许多东西但就是选择不到图元,这是怎么回事?</P>
<P>如果知道某图或块在某个区域,通过代码去自动选择,用上面的代码不行吗?该怎么做呢?谢谢!</P>

dfgs 发表于 2005-11-10 08:12:00

<P>没人知道吗?</P>

zxj_76 发表于 2005-11-10 08:34:00

<P>1、被选实体可见吗?(即在AUTOCAD窗口内)</P>

dfgs 发表于 2005-11-10 08:36:00

本帖最后由 作者 于 2005-11-10 16:25:17 编辑 <br /><br /> <P>可以看到的!在这个区域内我画了一些线条来测试!不行!</P>
<P>(看的人多,回答的少!?)</P>
页: [1]
查看完整版本: 请教选择的问题