Hope this would help you with it ..
Code:
(defun c:TesT (/ *error* blk vla value)
;;; Tharwat 16. Oct. 2011 ;;;
(cond ((not acdoc)
(setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object)))
)
)
(vl-load-com)
(defun *error* (msg)
(or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
(princ (strcat "\n** Error: " msg " **"))
)
(princ)
)
(if (setq blk (ssget "_+.:s" '((0 . "INSERT") (66 . 1))))
(progn
(vla-StartUndoMark acdoc)
(setq vla (vlax-ename->vla-object (ssname blk 0)))
(while
(foreach x (vlax-invoke vla "GetAttributes")
(if (not
(eq
(setq value
(getstring T
(strcat
"\n Enter string to change or " " " "< hit enter to leave the value > : "
"[ " (vla-get-textstring x)" ]" ))) ""
)
)
(vla-put-textstring x value)
)
)
)
(vla-EndUndoMark acdoc)
)
(princ)
)
(princ)
)
Tharwat