View Single Post
  #12   Report Post  
TimLeonard TimLeonard is offline
Member
 
Posts: 46
Default

Quote:
I defined the array as follows...

Dim saAttribs$(14) '//replaces individual vars; uses acAttribs enum
Thanks so much for working with me. I really appreciate it more than you know...

I did finally pieced/wrote something to send the updated values back to ACAD using following code. I hope it is built correctly, this is a major accomplishment for me... Pointers are appreciated...

Code:
     Dim attributeObj As AcadAttribute
    Dim BlockObj As AcadBlock
    Dim Cnt As Long

    Dim vAttrData
    vAttrData = xlSheet.UsedRange 'Copy Data as an Array from spreadsheet

       'Selection Set codeE
        Cnt = 2
        For Each elem In ThisDrawing.ModelSpace
           With elem
           
             If StrComp(.EntityName, "AcDbBlockReference", 1) = 0 Then
             If elem.HasAttributes Then
                 
                handle = elem.handle
                newAttribs = elem.GetAttributes

'         For i = LBound(newAttribs) To UBound(newAttribs)
          For i = 0 To UBound(newAttribs)  ' For Count = LBound(newAttribs) To UBound(newAttribs) 'Read attributes from block
              Dim Attr As AcadAttributeReference
              Set Attr = newAttribs(i)
              'Filter the Tagstring that contain "Addresses" 
              If Attr.TagString = "ADDRESS" Then
              If handle = vAttrData(Cnt, 1) Then
                   
                newAttribs(0).TextString = vAttrData(Cnt, 2)
                newAttribs(1).TextString = vAttrData(Cnt, 3)
                newAttribs(2).TextString = vAttrData(Cnt, 4)
                newAttribs(3).TextString = vAttrData(Cnt, 5)
                newAttribs(4).TextString = vAttrData(Cnt, 6)
                newAttribs(5).TextString = vAttrData(Cnt, 7)
                newAttribs(6).TextString = vAttrData(Cnt, 8)
                newAttribs(7).TextString = vAttrData(Cnt, 9)
                newAttribs(8).TextString = vAttrData(Cnt, 10)
                newAttribs(9).TextString = vAttrData(Cnt, 11)
                newAttribs(10).TextString = vAttrData(Cnt, 12)
                newAttribs(11).TextString = vAttrData(Cnt, 13)
                
                newAttribs(0).Update
                newAttribs(1).Update
                newAttribs(2).Update
                newAttribs(3).Update
                newAttribs(4).Update
                newAttribs(5).Update
                newAttribs(6).Update
                newAttribs(7).Update
                newAttribs(8).Update
                newAttribs(9).Update
                newAttribs(10).Update
                newAttribs(11).Update
                  
              End If
             Cnt = Cnt + 1
            Exit For
           End If 'Address
          Next i

         End If
         End If
       End With 'elem
    Next elem

Last edited by TimLeonard : June 9th 16 at 02:47 PM Reason: Typo