[求助]关于getxdata的问题
我在程序中给一个text类附加了一组信息,这些信息由字符串,整性和实数组成,我想在下边的程序中用getxdata莱取出附加信息,但是每次返回的值都为空,我不知道怎么回事。我看帮助,但是里面值给出了为string形的代码,请各位大侠帮忙解决一下。给点代码。unit3Type(0) = 1001: unit3Data(0) = "尺寸"<BR>unit3Type(1) = 1071: unit3Data(1) = 3 '形状<BR>unit3Type(2) = 1000: unit3Data(2) = tri_textp(0) '单元所含的第一个节点<BR>unit3Type(3) = 1000: unit3Data(3) = tri_textp(1) ' 二<BR>unit3Type(4) = 1000: unit3Data(4) = tri_textp(2) ' 三<BR>unit3Type(5) = 1000: unit3Data(5) = "n" ' 四<BR>unit3Type(6) = 1040: unit3Data(6) = tri_m ' 实数 <BR>unit3Type(7) = 1040: unit3Data(7) = tri_z ' 实数
text.SetXData unit3Type, unit3Data
text.updata 完整一点的代码呢? 其实,我的目的是读出来扩展数据,刚才的代码是建立扩展数据的,以下是我读出的
Dim chakan As AcadEntity<BR>Dim point As AcadPoint<BR>Dim tem_text As AcadText<BR>Dim ckType(0 To 7) As Variant ' 给应用程序预开数组<BR>Dim ckData(0 To 7) As Variant '给附加的节点编号开数组<BR>Dim number As Integer<BR>ThisDrawing.Utility.GetEntity chakan, point, "请选择单元号"<BR>If TypeName(chakan) = "IAcadText" Then<BR> Set tem_text = chakan<BR> tem_text.GetXData "", ckType, ckData<BR> If VarType(ckData) < vbArray Then ' 注意VarType函数的返回值<BR> MsgBox "对象不包含扩展数据"<BR> Else<BR> Dim i As I
number = UBound(ckData) - LBound(ckData) + 1<BR> For i = 0 To number - 1<BR> MsgBox CStr(ckType(i)) & i & ckData(i)<BR> Next i<BR> End If
请老师指点 Dim ckType,ckData 你真是神了。牛 牛 谢谢
页:
[1]