Here, try this mhupp's mod...
;;----------------------------------------------------------------------------;;
;; PULL BLOCKS NAME TO UPDATE ATTRIBUTE
(defun C:ATTBLKNAME () (C:ABN))
(defun C:ABN ( / effectivename ent Name Att )
(defun effectivename ( ent / blk rep )
(if (wcmatch (setq blk (cdr (assoc 2 (entget ent)))) "`**")
(if
(and
(setq rep
(cdadr
(assoc -3
(entget
(cdr
(assoc 330
(entget
(tblobjname "block" blk)
)
)
)
'("AcDbBlockRepBTag")
)
)
)
)
(setq rep (handent (cdr (assoc 1005 rep))))
)
(setq blk (cdr (assoc 2 (entget rep))))
)
)
blk
)
(while (setq ent (car (entsel "\nSelect Block"))) ;gets an entity name using while will keep repeating if you keep selecting an entity
(if (= (cdr (assoc 0 (entget ent))) "INSERT") ;test if its a block
(progn
(setq Name (effectivename ent)) ; pulls the name
(setq Att (vlax-ename->vla-object (car (nentsel "Select Attribute Text to update")))) ; nentsel can get entity names inisde blocks
(vla-put-textstring Att Name) ;update entity with name
)
(progn ;if entity isn't a block will prompt user
(prompt "\nNot a Block Pick again")
(c:ABN) ;and start the comman over again.
)
)
)
(princ)
)