;;;save layer name, color, linetype. ;;; ;;; ;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 4-28-96 ;;;> EDITED: 08-18-1999 ;;; (defun c:lclt ( / vl_list newlist) (progn (setq cur_lay (getvar"clayer")) (setq it (tblnext "layer" "T")) (setq itn (list(cdr(assoc 2 it))(cdr(assoc 62 it))(cdr(assoc 6 it)))) (setq newlist (list itn)) (while (setq it (tblnext "layer")) (setq lname (cdr(assoc 2 it))) (setq lcolor (cdr(assoc 62 it))) (setq lltyp (cdr(assoc 6 it))) ; (if lcolor nil ; (setq lcolor (strcat "BYLAYER="(itoa(cdr(assoc 62 laent))))) ; ) ; (if lltyp nil ; (setq lltyp (strcat "BYLAYER="(cdr(assoc 6 laent)))) ; ) (progn (setq itn (list lname lcolor lltyp)) (setq newlist (append newlist(list itn))) );progn );while ; (setq newlist (acad_strlsort newlist)) );progn (foreach n newlist ; (if(not(wcmatch (car n) "*|*")) (if vl_list (setq vl_list (append vl_list (list n))) (setq vl_list (list n)) ) ; ) ) ; (setq cur_ndx (-(length vl_list)(length (member cur_lay vl_list)))) (setq lay_f (open (strcat(getvar"dwgname")".LLT") "w")) (foreach n vl_list (print n lay_f)) (close lay_f) ) (defun c:rlclt ( / ffname) (setq rline_lst nil) (setq fname (ustr 1 "Layer Template Filename" (if fname fname (strcat(getvar"dwgname")".LLT")) nil)) (while (not (setq ffname (findfile fname)) ) (princ "\nFile not found, Please enter a valid name. ") (setq fname (ustr 1 "Layer Template Filename" (if fname fname (strcat(getvar"dwgname")".LLT")) nil)) ) (setq lay_f (open ffname "r")) (while (setq rline (read-line lay_f)) (if (eq(type rline)'STR) (if rline_lst (setq rline_lst (append rline_lst (list (read rline)))) (setq rline_lst (list(list (read rline)))) ) ) ) (close lay_f) (setq cnt 1 llen (length rline_lst) ) (while (< cnt llen) (if(and (eq(type(car(nth cnt rline_lst)))'STR) (tblsearch "layer" (car(nth cnt rline_lst))) ) (command ".layer" "c" (cadr(nth cnt rline_lst)) (car(nth cnt rline_lst)) ; "lt" ; (caddr(nth cnt rline_lst)) ; (car(nth cnt rline_lst)) "" ) ) (setq cnt (1+ cnt)) ) )