azfa 发表于 2008-9-28 19:38:00

[求助]请问:为什么我用PolyLine画不出三维多段线

本帖最后由 作者 于 2008-9-28 19:41:53 编辑 <br /><br /> <p>Sub ThdPolyline()<br/>&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp; Dim Thplineobj As AcadPolyline<br/>&nbsp;&nbsp; Dim Thpoints(14) As Double<br/>&nbsp; <br/>&nbsp;&nbsp; <br/>&nbsp;&nbsp; '为三维顶点赋值<br/>&nbsp;&nbsp; Thpoints(0) = 50<br/>&nbsp;&nbsp; Thpoints(1) = 50<br/>&nbsp;&nbsp; Thpoints(2) = 100<br/>&nbsp;&nbsp; <br/>&nbsp;&nbsp; Thpoints(3) = 100<br/>&nbsp;&nbsp; Thpoints(4) = 50<br/>&nbsp;&nbsp; Thpoints(5) = 0<br/>&nbsp;&nbsp; <br/>&nbsp;&nbsp; Thpoints(6) = 150<br/>&nbsp;&nbsp; Thpoints(7) = 250<br/>&nbsp;&nbsp; Thpoints(8) = 150<br/>&nbsp;&nbsp; <br/>&nbsp;&nbsp; Thpoints(9) = 250<br/>&nbsp;&nbsp; Thpoints(10) = -50<br/>&nbsp;&nbsp; Thpoints(11) = 0<br/>&nbsp;&nbsp; <br/>&nbsp;&nbsp; Thpoints(12) = 350<br/>&nbsp;&nbsp; Thpoints(13) = 0<br/>&nbsp;&nbsp; Thpoints(14) = 150<br/>&nbsp;&nbsp; <br/>&nbsp; <br/>&nbsp;&nbsp; Set Thplineobj = ThisDrawing.ModelSpace.AddPolyline(Thpoints)<br/>&nbsp;&nbsp; <br/>&nbsp;&nbsp; ThisDrawing.Application.ZoomAll<br/>&nbsp;&nbsp; <br/>&nbsp;&nbsp; <br/>End Sub</p><p>2006,2007都试过了,都不对,不知道哪搞错,请高手指点.</p>

azfa 发表于 2008-9-29 11:17:00

<p>已解决,函数调用错误,应该用Add3DPoly函数。</p><p>不过既然AddPolyline画二维多段线何必设置三维数组呢。Z坐标没起到作用嘛。</p><p></p>

sailorcwx 发表于 2008-9-30 13:35:00

AddPolyline的第三个参数不是Z坐标,而是高程

azfa 发表于 2008-10-2 09:43:00

谢谢!多谢指教!
页: [1]
查看完整版本: [求助]请问:为什么我用PolyLine画不出三维多段线