I had changed 2 one line of code
See if this working now:
Just a Q: But why dont you use the local variables?
Code:
;;;Program found on AutoCAD discussion groups done by Yancka
(defun c:urev( / );;;atts inserts ss1)
(vl-load-com)
(cond
((or (null (setq ss1 (ssget "X" '((0 . "INSERT")(2 . "`*U*,BallValve_Flip_01")(66 . 1)))));<-- added to filter `*U* to get anonimous blocks
(= 0 (sslength ss1))
)
(princ "\nNo insertions of BallValve_Flip_01 found.")
)
(T
(setq
Inserts (vl-remove-if '(lambda(x)(not (eq "BallValve_Flip_01"(vla-get-effectivename x))))
(mapcar (function vlax-ename->vla-object)
(vl-remove-if
(function listp)
(mapcar (function cadr) (ssnamex ss1))
)
)
)
;;Get a list of attributes and their tagstrings, thus
;; ((tagstring1 . attributereference1)(tagstring2 . attributereference2)...)
atts (mapcar
(function
(lambda (att)
(cons (vla-get-tagstring att) att)
)
)
;;build a list of all the attributes in all the insertions we found
(apply
'append
(mapcar (function (lambda (i) (vlax-invoke i 'GetAttributes)))
Inserts
)
)
)
;;remove the attributes without the tagstring we want
atts (vl-remove-if-not
(function
(lambda (att)
(= (car att) "UPOD")
)
)
atts
)
)
(foreach att atts
(vla-put-textstring (cdr att) "HUH?")
)
)
)
)
~'J'~