- 积分
- 574
- 明经币
- 个
- 注册时间
- 2005-5-11
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
Dim points(0 To 5) As Double
' 为二维多段线顶点赋值 points(0) = 2: points(1) = 4 points(2) = 4: points(3) = 2 points(4) = 6: points(5) = 4
Set plineObj = doc1.ModelSpace.AddLightWeightPolyline(points)
上面的没有任何问题
但如果我有一个字符串如下: dim objstr as string= "0,0|740.4857,0|740.4857,-89.8498|0,-89.8498" 通过objstr创建一个多线段,怎么老是出错呢?
'db是ado的一个记录集 dim db as new adodb.recordset
Dim points dim objsum,i as integer
objstr = Replace(objstr, "|", ",") points = Split(objstr, ",") objsum = db("summit_sum") * 2 - 1 'db("summit_sum") 是多线段的顶点个数
ReDim repoints(0 To objsum) As double 'ReDim repoints(0 To objsum) As variant 这两种定义方式都不行 ''ReDim repoints(0 To objsum)
For i = 0 To objsum repoints(i) = points(i) Debug.Print points(i) Next
Set plineObj = doc1.ModelSpace.AddLightWeightPolyline(points) '这一句添加时老是出错:无效的过程调用或参数 '我试了上面好几种定义方式都不行, |
|