jimzhoujim 发表于 2009-3-10 19:54:00

扩展字典

<p>Dim objdict As AcadDictionary<br/>Dim objxrecord As AcadXRecord<br/>Dim xdata(0 To 2) As Variant<br/>Dim xdatatype(0 To 2) As Variant</p><p>xdata(0) = UserForm1.ComboBox2.Text<br/>xdata(1) = UserForm1.ComboBox1.Text<br/>xdata(2) = Templ.Length<br/>xdatatype(0) = 1001<br/>xdatatype(1) = 1002<br/>xdatatype(2) = 1003<br/>Set objdict = Templ.GetExtensionDictionary()<br/>Set objxrecord = objdict.AddXRecord(lname)<br/>objxrecord.SetXRecordData xdatatype, xdata<br/>ThisDrawing.ActiveLayer = ThisDrawing.Layers.Item("0")<br/>If Templ.HasExtensionDictionary Then<br/>MsgBox "has"<br/>Else<br/>MsgBox "no"<br/>End If<br/>Dim objdict1 As AcadDictionary<br/>Dim objxrecord1 As AcadXRecord<br/>Dim xdata1(0 To 2) As Variant<br/>Dim xdatatype1(0 To 2) As Variant<br/>Set objdict1 = Templ.GetExtensionDictionary()<br/>Set objxrecord1 = objdict1.GetObject(lname)<br/>objxrecord1.GetXRecordData xdatatype1, xdata1<br/>MsgBox "is" &amp; xdatatype1(0) &amp; xdata1(0)</p><p></p><p>大家帮我看看,为什么读不出来扩展数据?</p><p>谢谢</p>

zzyong00 发表于 2009-3-11 17:17:00

<p>Dim xdata(0 To 2) As Variant<br/>Dim xdatatype(0 To 2) As Variant</p><p>定义的不对</p>

jimzhoujim 发表于 2009-3-12 09:45:00

<p>请问那应该要怎么定义呢?</p>
页: [1]
查看完整版本: 扩展字典