明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1290|回复: 2

[讨论]AddLightWeightPolyline无效

[复制链接]
发表于 2009-1-14 08:38:00 | 显示全部楼层 |阅读模式

实时错误 '-2145320943 (80210011)':

Too few elements in SafeArray or total number of elements is not a multiple of three

-------------------------------------------------------------------

以下代码开始运行的好好的,不知何时突然不行了!

Dim PL(10) As Double

    PL(0) = 0
    PL(1) = 0

    PL(2) = 0
    PL(3) = 300

    PL(4) = 300
    PL(5) = 300

    PL(6) = 300
    PL(7) = 0

    PL(8) = 0
    PL(9) = 0

Set P = acaddoc.ModelSpace.AddLightWeightPolyline(PL)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2009-1-14 13:11:00 | 显示全部楼层
Sub  AddLightWeightPolyline()
    ' This example creates a lightweight polyline in model space.
   
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 9) As Double
   
    ' Define the 2D polyline points
    points(0) = 0: points(1) = 0
    points(2) = 0: points(3) = 300
    points(4) = 300: points(5) = 300
    points(6) = 300: points(7) = 0
    points(8) = 0: points(9) = 0
       
    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
  
   
End Sub
试试看
 楼主| 发表于 2009-1-14 16:42:00 | 显示全部楼层

感谢,楼上!

错误原因找到了!

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 04:47 , Processed in 0.142708 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表