;;;Generate a sorted list of layer names in the drawing. ;;; ;;; The list is written to a ;;; file named .LAY in the current directory. ;;; The list can be viewed in AutoCAD by entering ;;; !newlist at the command prompt. A page by page ;;; listing can be viewed by entering LLIST after the ;;; lay_list routine has been run. ;;; ;;; ;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 4-28-96 ;;;> EDITED: 01-31-2003 ;;; (defun c:laylst ( / it itn lay_f lay_str) (progn (setq it (tblnext "layer" "T")) (setq itn (cdr(assoc 2 it))) (setq newlist (list itn)) (while (setq it (tblnext "layer")) (progn (setq itn (cdr(assoc 2 it))) (setq newlist (append newlist(list itn))) );progn );while (setq newlist (acad_strlsort newlist)) (if (wcmatch (strcase (getvar "dwgname")) "*.DWG") (setq layfilenm (strcat(substr(getvar"dwgname")1(-(strlen(getvar"dwgname"))4))".LAY")) (setq layfilenm (strcat(getvar"dwgname")".LAY")) ) (setq lay_f (open layfilenm "w")) (foreach n newlist (write-line n lay_f)) (close lay_f) );progn );defun (defun C:LLIST ( / ) (foreach n newlist (princ (strcat "\n" n))) (princ) );defun