offloading 发表于 2009-1-14 08:38:00

[讨论]AddLightWeightPolyline无效

<p>实时错误 '-2145320943 (80210011)':</p><p>Too few elements in SafeArray or total number of elements is not a multiple of three</p><p>-------------------------------------------------------------------</p><p>以下代码开始运行的好好的,不知何时突然不行了!</p><p>Dim PL(10) As Double</p><p>&nbsp;&nbsp;&nbsp; PL(0) = 0<br/>&nbsp;&nbsp;&nbsp; PL(1) = 0</p><p>&nbsp;&nbsp;&nbsp; PL(2) = 0<br/>&nbsp;&nbsp;&nbsp; PL(3) = 300</p><p>&nbsp;&nbsp;&nbsp; PL(4) = 300<br/>&nbsp;&nbsp;&nbsp; PL(5) = 300</p><p>&nbsp;&nbsp;&nbsp; PL(6) = 300<br/>&nbsp;&nbsp;&nbsp; PL(7) = 0</p><p>&nbsp;&nbsp;&nbsp; PL(8) = 0<br/>&nbsp;&nbsp;&nbsp; PL(9) = 0</p><p>Set&nbsp;PP = acaddoc.ModelSpace.AddLightWeightPolyline(PL)</p>

dbczhaoy 发表于 2009-1-14 13:11:00

<pre class="Code"><pre class="Code">SubAddLightWeightPolyline()<br/>&nbsp;&nbsp;&nbsp; ' This example creates a lightweight polyline in model space.<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Dim plineObj As AcadLWPolyline<br/>&nbsp;&nbsp;&nbsp; Dim points(0 To 9) As Double<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; ' Define the 2D polyline points<br/>&nbsp;&nbsp;&nbsp; points(0) = 0: points(1) = 0<br/>&nbsp;&nbsp;&nbsp; points(2) = 0: points(3) = 300<br/>&nbsp;&nbsp;&nbsp; points(4) = 300: points(5) = 300<br/>&nbsp;&nbsp;&nbsp; points(6) = 300: points(7) = 0<br/>&nbsp;&nbsp;&nbsp; points(8) = 0: points(9) = 0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; ' Create a lightweight Polyline object in model space<br/>&nbsp;&nbsp;&nbsp; Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)<br/>&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; <br/>End Sub<br/></pre><pre class="Code">试试看</pre></pre>

offloading 发表于 2009-1-14 16:42:00

<p>感谢,楼上!</p><p>错误原因找到了!</p>
页: [1]
查看完整版本: [讨论]AddLightWeightPolyline无效