请教延伸数据问题
Sub ShuRu()<BR>Dim xhobj As AcadText<BR>Dim xuhao As Integer<BR>xuahao = ThisDrawing.Utility.GetString(1, vbCrLf & "序号:")<BR>Dim datatype(0 To 1) As Integer<BR>Dim data(0 To 1) As Variant<BR>datatype(0) = 1001: data(0) = "number"<BR>datatype(1) = 1000: data(1) = "xuhao"<BR>xhobj.SetXData datatype, data<BR>End Sub请问上面的代码能将用户输入的序号的值加入到xhobj的文本对象中吗?我运行后提示错误91,为什么呢? Sub test()<BR>Dim xhobj As AcadText<BR>Dim xuhao As Integer<BR>Dim pnt(2) As Double<BR>xuahao = ThisDrawing.Utility.GetString(1, vbCrLf & "序号:")<BR>Set xhobj = ThisDrawing.ModelSpace.AddText(xuahao, pnt, 5)<BR>Dim datatype(0 To 1) As Integer<BR>Dim data(0 To 1) As Variant<BR>datatype(0) = 1001: data(0) = "我的序号"<BR>datatype(1) = 1000: data(1) = xuahao<BR>xhobj.SetXData datatype, data<BR>End Sub<BR> 感谢版主对我的帮助,有贴比复,献花一朵,表示感谢!上一个程序我看懂了,我想问的是必须用“set xhobj=....”吗?这样就在cad图形中生成了序号,我不想生成,只想加入延伸数据,能办到吗?
页:
[1]