- 积分
- 6982
- 明经币
- 个
- 注册时间
- 2003-5-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-4-24 13:13:00
|
显示全部楼层
刚刚试了一下
不能直接引用lll.StartPoint 而不是数组redim的问题
如果直接引用 则
“运行时错误‘451:
property let 过程未定义,property get 过程未返回对象”
下面这样就可以了
Private Sub CommandButton1_Click() Dim myss As AcadSelectionSet Set myss = ThisDrawing.SelectionSets.Add("125553") Dim llll As AcadLine Dim gpcode(0) As Integer Dim datavalue(0) As Variant Dim linecount, i, j, q As Integer Dim stpt, enpt As Variant Dim vst As Variant gpcode(0) = 0 datavalue(0) = "line" myss.Select acSelectionSetAll, , , gpcode, datavalue ReDim lineco(myss.Count - 1, 3) As Variant i = 0 For Each lll In myss For j = 0 To 1 vst = lll.StartPoint 'lineco(i, j) = lll.StartPoint(0) lineco(i, j) = vst(0) lineco(i, j + 1) = vst(1) Next 'For q = 2 To 3 'lineco(i, q) = lll.EndPoint(0) 'lineco(i, q + 1) = lll.EndPoint(1) 'Next i = i + 1 Next
End Sub |
|