为何取不到字符串
<p> Function getattributes(ByVal ThisDrawing As AcadDocument, ByVal dwgname As String, ByVal acadapp As AcadApplication)<br/> Dim insertionPnt(0 To 2) As Double<br/> Dim blockRefObj As AcadBlockReference<br/> insertionPnt(0) = 0.0# : insertionPnt(1) = 0.0# : insertionPnt(2) = 0.0#<br/> 'insertionPnt(0) = 2.0# : insertionPnt(1) = 2.0# : insertionPnt(2) = 0<br/> blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, dwgname, 1.0#, 1.0#, 1.0#, 0)<br/> '插入图形文件或当前图形中已定义的命名块。</p><p> ' Get the attributes for the block reference<br/> Dim varAttributes As Object<br/> varAttributes = blockRefObj.GetAttributes<br/> ' Move the attribute tags and values into a string to be displayed in a Msgbox<br/> Dim strAttributes As String<br/> Dim I As Integer<br/> For I = LBound(varAttributes) To UBound(varAttributes)<br/> strAttributes = strAttributes & " Tag: " & varAttributes(I).TagString & _<br/> " Value: " & varAttributes(I).textString & " "<br/> ' MsgBox(varAttributes(I).textString)<br/> ' MsgBox(varAttributes(I).TagString())<br/> Next<br/> MsgBox("The attributes for blockReference " & blockRefObj.Name & " are: " & strAttributes, , "GetAttributes Example")<br/> '文件的名字blockRefObj.Name</p><p> End Function</p><p>varAttributes(I).TagString 不知道为什么 取不到任何字符串!</p> 函数应该有返回值 <p>不是 MsgBox("The attributes for blockReference " & blockRefObj.Name & " are: " & strAttributes, , "GetAttributes Example")<br/>无法显示出来</p>
页:
[1]