bjbjbjbj 发表于 2006-4-21 08:51:00

求助,如何把提取的闭合pline的顶点坐标转化为多边形的三维坐标

帮忙啊,我急用啊

雪山飞狐_lzh 发表于 2006-4-21 20:00:00

<P>Function Point2dTo3d(pnts As Variant) As Variant<BR>&nbsp;&nbsp;&nbsp; Dim n As Integer<BR>&nbsp;&nbsp;&nbsp; Dim dots() As Double<BR>&nbsp;&nbsp;&nbsp; n = (UBound(pnts) + 1) / 2<BR>&nbsp;&nbsp;&nbsp; If n &gt; 0 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReDim dots(n * 3 - 1) As Double<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For i = 0 To n - 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dots(i * 3) = pnts(i * 2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dots(i * 3 + 1) = pnts(i * 2 + 1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dots(i * 3 + 2) = 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next i<BR>&nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp; Point2dTo3d = dots<BR>End Function</P>
<P>Sub tt()<BR>Dim pnts(3) As Double<BR>For i = 0 To 3<BR>pnts(i) = i<BR>Next i</P>
<P>dots = Point2dTo3d(pnts)</P>
<P>For i = 0 To UBound(dots)<BR>Debug.Print dots(i)<BR>Next i<BR>End Sub<BR></P>

bjbjbjbj 发表于 2006-4-21 21:39:00

谢谢了.很好用啊
页: [1]
查看完整版本: 求助,如何把提取的闭合pline的顶点坐标转化为多边形的三维坐标