; from this posting / Moshe-A ; ; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/is-there-a-gatte-equivalent-for-lt2025/m-p/13349036#13346232 ; ; with counter for failed edits ; (defun c:applyClient (/ BNAME TAG client ss ctr ctrfail ename subent sube) (setq BNAME "attriba*") ; const (setq TAG "client") ; const (if (and (/= (setq client (getstring t "\nClient name: ")) "") (setq ss (ssget "_x" (list '(0 . "insert") (cons '2 (strcat BNAME ",`*U*")) '(66 . 1)))) ) (progn (setq ctr 0 ctrfail 0) (foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (setq subent (entnext ename) sube (entget subent)) (if (wcmatch (strcase (vla-get-EffectiveName (vlax-ename->vla-object ename)))(strcase BNAME)) (while (/= (cdr (assoc '0 sube)) "SEQEND") (if (eq (strcase (cdr (assoc '2 sube))) (strcase TAG)) (if (entmod (subst (cons '1 client) (assoc '1 (reverse sube)) sube)) (setq ctr (1+ ctr)) (progn (setq ctrfail (1+ ctrfail)) (princ (strcat "\n1 update failed (Block: " (vla-get-EffectiveName (vlax-ename->vla-object ename)) " | Att-Layer: " (cdr (assoc 8 sube)) " | Tab: " (cdr (assoc 410 sube)) ")")) ) ) ); if (setq subent (entnext subent) sube (entget subent)) ); while ); if ); foreach (cond ((= (+ ctr ctrfail) 0) (prompt "\nNo attributes found to update.") ); case (t (prompt (strcat "\n\n" (itoa ctr) " attribute"(if (= ctr 1) "" "s") " updated" (if (zerop ctrfail) "." (strcat ", " (itoa ctrfail) " failed")))) ); case ); cond ); progn ); if (princ) )