; Att2Att takes attribute values from source Block and places to matching tags in target Block ; OP: ; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-values-from-one-attribute-block-to-selected-block/m-p/12899135#M468702 (defun C:Att2Att (/ attlst1 attlst2 atttag lst ss1 ss2 tmp) (vl-load-com) (while (not ss1) (princ"\nSelect Source Block with Attributes...") (setq ss1 (ssget "_+.:E:S" '((0 . "INSERT")(66 . 1)))) ) ; while (while (not ss2) (princ"\nSelect Target Block with Attributes...") (setq ss2 (ssget "_+.:E:S" '((0 . "INSERT")(66 . 1)))) ) ; while (if (and ss1 ss2) (progn (setq attlst1 (vlax-invoke (vlax-ename->vla-object (ssname ss1 0)) 'getattributes) ; get source attributes attlst2 (vlax-invoke (vlax-ename->vla-object (ssname ss2 0)) 'getattributes) ; get target attributes ) (foreach itm attlst1 ; get from source list of assoc pair of tag and val (setq lst (append lst (list (cons (strcase (vla-get-tagString itm)) (vla-get-textString itm))))) ) ; foreach (foreach itm attlst2 ; get from target list tag and see if there's match to source tag then place value (setq atttag (strcase (vla-get-tagString itm))) (if (setq tmp (assoc atttag lst)) ; if matching tag (vla-put-textString itm (cdr tmp)) ; put source att value to target ) ) ; foreach ) ; progn ) ; if (princ) ; clean exit ) ; defun