;;;Writes a listing of block names and the layers they use to BLKLAY.LST ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 1/04/2001 ;;;> EDITED: 05-06-2001 ;;; (defun c:blklay ( / bl_lst) (setq tblstrt T bl_lst nil) (setq ofil (open "blklay.lst" "w")) (setq fname (getvar"dwgname")) (while (wcmatch fname "\\") (setq fname (substr fname 2)) ) (write-line (strcat "Block name/Layer listing for: "(getvar"dwgprefix")fname)ofil) (while (setq blk1 (tblnext "block" tblstrt)) (setq bl_lst nil) (setq val -2) (write-line (cdr(assoc 2 blk1)) ofil) (while (and (entnext(cdr(assoc val blk1))) (/= "SEQEND" (cdr(assoc 0(entget(entnext(cdr(assoc val blk1))))))) ) (setq blk1 (entget(entnext(cdr(assoc val blk1))))) (if bl_lst (if (member (cdr(assoc 8 blk1)) bl_lst) nil (setq bl_lst (append bl_lst (list(cdr(assoc 8 blk1))))) ) (setq bl_lst (list(cdr(assoc 8 blk1)))) ) ; (princ (cdr(assoc 8 blk1))) ; (princ "\n") ; (if bl_lst ; (if (member (cdr(assoc 8 blk1)) bl_lst) ; nil ; (progn ; (princ (cdr(assoc 8 blk1))) ; (princ " ") ; ) ; ) ; ) (setq val -1) ) ; (princ bl_lst) (foreach n bl_lst (if(eq(type n)'STR) (write-line (strcat " " n) ofil) ) ) (princ "\n") (setq tblstrt nil) (write-line "" ofil) ) (close ofil) )