用实体对象的GetXData获取扩展数据,SetXData设置扩展数据。其中组码为1001的就是注册外部应用程序名称,如已注册外部应用程序名: BH0。而组码为1000的就是字符串。下面是个例子,自己参考一下。

- [FONT=courier new]
- Dim DataType(0 To 9) As Integer
- Dim Data(0 To 9) As Variant
- Dim reals3(0 To 2) As Double
- Dim worldPos(0 To 2) As Double
-
- DataType(0) = 1001: Data(0) = "Test_Application"
- DataType(1) = 1000: Data(1) = "This is a test for xdata"
- DataType(2) = 1003: Data(2) = "0" ' layer
- DataType(3) = 1040: Data(3) = 1.23479137438413E+40 ' real
- DataType(4) = 1041: Data(4) = 1237324938 ' distance
- DataType(5) = 1070: Data(5) = 32767 ' 16 bit Integer
- DataType(6) = 1071: Data(6) = 32767 ' 32 bit Integer
- DataType(7) = 1042: Data(7) = 10 ' scaleFactor
- reals3(0) = -2.95: reals3(1) = 100: reals3(2) = -20
- DataType(8) = 1010: Data(8) = reals3 ' real
-
- worldPos(0) = 4: worldPos(1) = 400.99999999: worldPos(2) = 2.798989
- DataType(9) = 1011: Data(9) = worldPos ' world space position
-
- ' Attach the xdata to the line
- lineObj.SetXData DataType, Data
-
- ' Return the xdata for the line
- Dim xdataOut As Variant
- Dim xtypeOut As Variant
- lineObj.GetXData "", xtypeOut, xdataOut
- [/FONT]
|