wholin 发表于 2006-8-26 12:52:00

在选择集时能不能用画一条直线来选择图元?

<P>在选择集时能不能用画一条直线来选择图元,而不用框选的方式?</P>
<P>意思就是画一条直线,跟这个直线相交的所有图元均被选中</P>

雪山飞狐_lzh 发表于 2006-8-30 12:11:00

在图元很多的时候这样要比框选要慢

cqy 发表于 2006-8-30 13:35:00

沿着直线做若干个选择集.

wholin 发表于 2006-9-1 09:16:00

<TABLE class=tablebody2 style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all" width="90%" border=0>
<TBODY>
<TR>
<TD style="FONT-SIZE: 9pt; LINE-HEIGHT: 12pt" width="100%">
<P><IMG alt=发贴心情 src="http://www.mjtd.com/Bbs/skins/default/topicface/face1.gif" border=0>&nbsp;<B></B><BR>沿着直线做若干个选择集. ?</P>
<P>&nbsp; 这说的轻巧,但要怎样实现得了呢</P></TD></TR></TBODY></TABLE>

雪山飞狐_lzh 发表于 2006-9-2 18:01:00

以直线的包装盒为线框用选择集选择,然后依次判断各实体是否与直线相交

cqy 发表于 2006-9-3 13:48:00

WHOLIN高明之士,实现应不难:1)直线设定为N等份,求出各等份点坐标,2)以各等份点建立选择集,3)建立1-N的循环.

zhuxuhong 发表于 2006-9-3 16:04:00

<DIV>哪有没这么复杂的?建立选择集有acSelectionSetFence方式的</DIV>
<DIV>&nbsp;&nbsp; '起点<BR>&nbsp;&nbsp; FromPnt = ThisDrawing.Utility.GetPoint(, vbCrLf &amp; "扯旗线起点: ")<BR>&nbsp;&nbsp; If err Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; err.Clear<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End<BR>&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; '终点<BR>&nbsp;&nbsp; Topnt = ThisDrawing.Utility.GetPoint(FromPnt, vbCrLf &amp; "扯旗线终点: ")<BR>&nbsp;&nbsp; If err Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; err.Clear<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End<BR>&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>&nbsp;&nbsp; '画标注线<BR>&nbsp;&nbsp; Set LineObj = ThisDrawing.ModelSpace.AddLine(FromPnt, Topnt)<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; '与标注线相交的线段组成选择集<BR>&nbsp;&nbsp; Set ssetobj = CreateSelectionSet("ObjSet")<BR>&nbsp;&nbsp; mode = acSelectionSetFence<BR>&nbsp;&nbsp; pointsArray(0) = FromPnt(0): pointsArray(1) = FromPnt(1): pointsArray(2) = 0<BR>&nbsp;&nbsp; pointsArray(3) = Topnt(0): pointsArray(4) = Topnt(1): pointsArray(5) = 0<BR>&nbsp;&nbsp; gpCode(0) = 0: dataValue(0) = "LINE"<BR>&nbsp;&nbsp; ssetobj.SelectByPolygon mode, pointsArray, gpCode, dataValue<BR>&nbsp;&nbsp; <BR></DIV>
页: [1]
查看完整版本: 在选择集时能不能用画一条直线来选择图元?