- 积分
- 1804
- 明经币
- 个
- 注册时间
- 2003-6-6
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2004-9-23 13:40:00
|
显示全部楼层
这是完整的一段代码这样是不是不行?
Sub test() Dim Po(7) As Double Dim LWPoLine As AcadLWPolyline Dim DataType(0 To 1) As Integer Dim Data(0 To 1) As Variant Dim XTypeOut As Variant, XDateOut As Variant
Po(0) = 0: Po(1) = 0 Po(2) = 20: Po(3) = 0 Po(4) = 20: Po(5) = 20 Po(6) = 0: Po(7) = 20 Set LWPoLine = ThisDrawing.ModelSpace.AddLightWeightPolyline(Po) '第一次写入 DataType(0) = 1001: Data(0) = "5g" DataType(1) = 1000: Data(1) = "true" LWPoLine.SetXData DataType, Data LWPoLine.GetXData "", XTypeOut, XDataOut MsgBox XTypeOut(0) & ";" & XDataOut(0) & vbCr & XTypeOut(1) & ";" & XDataOut(1) '改变值重新写入,读出的值没变 DataType(0) = 1001: Data(0) = "5g_5h" DataType(1) = 1000: Data(1) = "true" LWPoLine.SetXData DataType, Data LWPoLine.Update LWPoLine.GetXData "", XTypeOut, XDataOut MsgBox XTypeOut(0) & ";" & XDataOut(0) & vbCr & XTypeOut(1) & ";" & XDataOut(1) End Sub |
|