- UID
- 257315
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-5-11
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
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)
'这一句添加时老是出错:无效的过程调用或参数
'我试了上面好几种定义方式都不行, |
|