This is by no means a finished idea. Maybe as a group we can build it, if anybody's interested.
(defun attribute-list (x)
(vlax-safearray->list
(vlax-variant-value
(vla-GetAttributes x)
)
)
)
(defun each-attribute (x string newval)
(if (= (vlax-get-property x 'TagString) string)
(vlax-put-property
x
'TextString
(vlax-make-variant newval vlax-vbstring)
)
)
)
;;; FUNCTION
;;; Create a LIST of VLA-OBJECTS from a SELECTION SET
;;; Does not verify SELECTION SET or LIST
;;;
;;; ARGUMENTS
;;; ss = valid selection set
;;; lst = nil or valid list
;;;
;;; USAGE
;;; (setq ss (ssget))
;;; (setq vl-objs (ss->vla-list ss nil)
;;;
;;; add to the previous list of VLA-OBJECTS
;;; (setq ss (ssget))
;;; (setq vl-objs (ss->vla-list ss vl-objs))
;;;
;;; PLATFORMS
;;; 2000+
;;;
;;; AUTHOR
;;; Copyright© 2003 Mark S. Thomas
;;; mark.thomas@theswamp.org
;;;
;;; VERSION
;;; 1.0 Fri Nov 21, 2003
(defun ss->vla-list (ss lst)
(cond ((ssname ss 0)
(setq lst (append (list
(vlax-ename->vla-object (ssname ss 0))) lst))
(ss->vla-list (ssdel (ssname ss 0) ss) lst)); 1st cond
((null (ssname ss 0)) lst); 2nd cond
); cond
)
(defun blocksel (bname)
(ss->vla-list (ssget "x" (list (cons 2 bname))))
)
(foreach item (blocksel "addblocknamehere")
(setq att-list (attribute-list item))
(foreach att att-list
(each-attribute att "tagnamehere" "newvaluehere")
)
)
attribute-list function added to work with the foreach portion above. Sorry about not adding it before. I actually had it in, but didn't see it in any other code, so I erased it. P.S. All the above code is in pieces and parts. You'll need to work out how to put it all together. There might be more to it that you need. Also, Mark's part of it is just the ss->vla-list function and YES, it is a sweet function.