Message 1 of 12
Edit Attributes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Considering this code, I would like the Value of \85Tag to be pasted into the value of \76Tag and the Value of \84Tag to be pasted into the value of \75Tag.
(defun C:ListAttributes ()
(setq baselist (list))
(setq ename (car (entsel "\nSelect Block:")))
(while (not ename)
(princ "\nNothing Picked")
(setq ename (car (entsel "\nSelect Block:")))
)
(if (assoc 66 (setq elist (entget ename)))
(progn
(setq ename (entnext ename)
elist (entget ename))
(while (= "ATTRIB" (cdr (assoc 0 elist)))
(setq tag (cdr (assoc 2 elist))
val (cdr (assoc 1 elist)))
(setq baselist (append (list (list tag val)) baselist))
(setq ename (entnext ename)
elist (entget ename))
)
(foreach item baselist
(setq tag (car item)
val (cadr item))
(setq new_val (cond
((= tag "\\85") (cdr (assoc "\\76" baselist)))
((= tag "\\84") (cdr (assoc "\\75" baselist)))
(t val)
))
(setq target_ent (assoc tag elist))
(setq elist (subst (cons 1 new_val) target_ent elist))
)
(entmod elist)
(princ "\nAttributes rearranged successfully.")
)
(princ "\nNo attributes found in the selected block.")
)
(princ)
)