vba的一个多段线绘制问题
我用vba 编了一个程序,输入自变量范围绘制多段线,有些自变量能行有的就不行了弹出下列错误.说是 安全数组太少 或元素数目不是3的倍数,有那位高手知道怎么回事请指教。最好能给我讲讲解决的办法,我也很想和大家叫个朋友qq113080248 <p>区分两种多段线LightWeightPolyline和Polyline。详见AutoCAD ActiveX and VBA Reference</p><p>Sub Example_AddLightWeightPolyline()<br/> ' This example creates a lightweight polyline in model space.<br/> <br/> Dim plineObj As AcadLWPolyline<br/> Dim points(0 To 9) As Double<br/> <br/> ' Define the 2D polyline points<br/> points(0) = 1: points(1) = 1<br/> points(2) = 1: points(3) = 2<br/> points(4) = 2: points(5) = 2<br/> points(6) = 3: points(7) = 2<br/> points(8) = 4: points(9) = 4<br/> <br/> ' Create a lightweight Polyline object in model space<br/> Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)<br/> ZoomAll<br/> <br/>End Sub</p><p><br/>Sub Example_AddPolyline()<br/> ' This example creates a polyline in model space.<br/> <br/> Dim plineObj As AcadPolyline<br/> Dim points(0 To 14) As Double<br/> <br/> ' Define the 2D polyline points<br/> points(0) = 1: points(1) = 1: points(2) = 0<br/> points(3) = 1: points(4) = 2: points(5) = 0<br/> points(6) = 2: points(7) = 2: points(8) = 0<br/> points(9) = 3: points(10) = 2: points(11) = 0<br/> points(12) = 4: points(13) = 4: points(14) = 0<br/> <br/> ' Create a lightweight Polyline object in model space<br/> Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)<br/> ZoomAll<br/> <br/>End Sub</p>
页:
[1]