求助:文字加扩展数据无法实现
<p>文字加扩展数据无法实现:</p><p>Dim objText As AcadText<br/>Dim dataType(0 To 1) As Integer<br/> Dim data(0 To 1) As Variant<br/> dataType(0) = 1001: data(0) = "XData"<br/> dataType(1) = 1000: data(1) = "123"<br/> Dim ptinsert(2) As Double<br/> ptinsert(0) = 100: ptinsert(1) = 100: ptinsert(2) = 0<br/> AddText "AutoCAD 2004", ptinsert, 5<br/> objText.SetXData dataType, data</p><p>同样的方法直线没有问题,请帮忙。</p> <p>怎会呢?</p><p>Sub TEST()<br/>Dim objText As AcadText<br/>Dim dataType(0 To 1) As Integer<br/> Dim data(0 To 1) As Variant<br/> dataType(0) = 1001: data(0) = "XData"<br/> dataType(1) = 1000: data(1) = "123"<br/> Dim ptinsert(2) As Double<br/> ptinsert(0) = 100: ptinsert(1) = 100: ptinsert(2) = 0<br/> Set objText = ThisDrawing.ModelSpace.AddText("AutoCAD 2004", ptinsert, 5)<br/> objText.SetXData dataType, data<br/> Dim xdataOut As Variant<br/> Dim xtypeOut As Variant<br/> objText.GetXData "", xtypeOut, xdataOut<br/> MsgBox xtypeOut(0)<br/> MsgBox xdataOut(0)<br/> MsgBox xtypeOut(1)<br/> MsgBox xdataOut(1)<br/>End Sub</p> <p>感谢alin老师:</p><p>AddText "AutoCAD 2004", ptinsert, 5</p><p>Set objText = ThisDrawing.ModelSpace.AddText("AutoCAD 2004", ptinsert, 5)</p><p>这一句的问题,再次感谢!<br/></p><p><br/></p>
页:
[1]