arden 发表于 2006-9-5 20:15:00

请教多段线相交问题

<P>假设图内有大量的多段落线,任取其中一根,如何快速确定其它的多段线是否与所选这根相交?当然不能采用一根根试的办法</P>

雪山飞狐_lzh 发表于 2006-9-5 20:40:00

<P>先用GetBoundingBox返回对象边框的最大和最小点,再。。。</P>

arden 发表于 2006-9-5 21:03:00

<P>"先用GetBoundingBox返回对象边框的最大和最小点,再。。。"</P>
<P>是用最大和最小点做框选,然后再一根根与框选到的实体比较吗?这样做只是缩小了范围,还有没有其它办法</P>

zhuxuhong 发表于 2006-9-6 08:11:00

<DIV>用这种方法可以做到的</DIV>
<DIV>Dim ssetObj As AcadSelectionSet<BR>&nbsp;&nbsp;&nbsp; Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET2")<BR>&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; ' Add all the entities that lie within a fence to the selection set<BR>&nbsp;&nbsp;&nbsp; Dim mode As Integer<BR>&nbsp;&nbsp;&nbsp; Dim pointsArray(0 To 11) As Double<BR>&nbsp;&nbsp;&nbsp; mode = acSelectionSetFence<BR>&nbsp;&nbsp;&nbsp; pointsArray(0) = 28.2: pointsArray(1) = 17.2: pointsArray(2) = 0<BR>&nbsp;&nbsp;&nbsp; pointsArray(3) = -5: pointsArray(4) = 13: pointsArray(5) = 0<BR>&nbsp;&nbsp;&nbsp; pointsArray(6) = -3.3: pointsArray(7) = -3.6: pointsArray(8) = 0<BR>&nbsp;&nbsp;&nbsp; pointsArray(9) = 28: pointsArray(10) = -3: pointsArray(11) = 0<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; ssetObj.SelectByPolygon mode, pointsArray<BR></DIV>

arden 发表于 2006-9-9 16:31:00

没看明白,好象回答的不是我的问题
页: [1]
查看完整版本: 请教多段线相交问题