nxy_918 发表于 2006-3-23 11:09:00

如何得到选择集的BoundingBox

<P>我是这么搞得,好像太繁了,不知道有没有更好的方法,大家一起讨论一下</P>
<P>Dim Min_pt(0 To 2) As Double, Max_pt(0 To 2) As Double<BR>Dim Min_t(0 To 2) As Double, Max_t(0 To 2) As Double</P>
<P>For Each sobj In myss</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sobj.GetBoundingBox minExt, maxExt<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Min_pt(0) = minExt(0): Min_pt(1) = minExt(1): Min_pt(2) = minExt(2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Max_pt(0) = maxExt(0): Max_pt(1) = maxExt(1): Max_pt(2) = maxExt(2)<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Min_t(0) = minExt(0): Min_t(1) = minExt(1): Min_t(2) = minExt(2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Max_t(0) = maxExt(0): Max_t(1) = maxExt(1): Max_t(2) = maxExt(2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Min_t(0) &lt; Min_pt(0) Then Min_pt(0) = Min_t(0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Min_t(1) &lt; Min_pt(1) Then Min_pt(1) = Min_t(1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Max_t(0) &gt; Max_pt(0) Then Max_pt(0) = Max_t(0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Max_t(1) &gt; Max_pt(1) Then Max_pt(1) = Max_t(1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp; Next</P>

mccad 发表于 2006-4-1 18:34:00

这本身是排序法的使用。在网上你可以搜索一下。
页: [1]
查看完整版本: 如何得到选择集的BoundingBox