(defun c:listatt () (setq e (car (entsel))) (while e (setq enttyp (cdr (assoc 0 (entget e))) blknm (cdr (assoc 2 (entget e))) ) ;if entity is block insertion with attributes (princ (strcat "\nBlock = " blknm)) (if (and (equal enttyp "INSERT") (equal (cdr (assoc 66 (entget e))) 1) ) (setq e (attriblst e blknm)) ) (setq e (car (entsel))) ) (princ) ) (defun attriblst (ent name) (while (not (equal name "SEQEND")) (setq ent (entnext ent)) (setq name (cdr (assoc 0 (entget ent)))) (if (equal name "ATTRIB") (progn (setq attag (cdr (assoc 2 (entget ent)))) (setq attval (cdr (assoc 1 (entget ent)))) (princ "\nThe Value of attribute ") (princ attag) (princ " is ") (princ attval) ) ) ) (setq ent ent) )