;;;Reverse/Restore the display status of all layers (C:INVDISP, C:RSTDISP). ;;; When first called it writes script files to ;;; both Invert the display and Restore it and then executes the ;;; function C:INVDISP. To restore the layers as they were ;;; prior to the inversion execute the function C:RSTDISP or run the ;;; script file named RST?????.SCR (where ????? is an extraction ;;; from the drawing name. ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 12-8-95 ;;;> EDITED: 05-23-1999 ;;; (defun c:invdisp ( / tln cdstrl curdwg invscr rstscr n) (setq exprt(getvar"expert")) (setvar "expert" 3) (setq onlst nil offlst onlst thwlst onlst frzlst onlst) (setq tln (tblnext "LAYER" "T")) (while tln (if(<(cdr(assoc 62 tln))0) (setq offlst (append (list(cdr(assoc 2 tln))) offlst)) (setq onlst (append (list(cdr(assoc 2 tln))) onlst)) );if (if(eq 0(rem(cdr(assoc 70 tln))2)) (setq thwlst (append (list(cdr(assoc 2 tln))) thwlst)) (setq frzlst (append (list(cdr(assoc 2 tln))) frzlst)) );if (setq tln (tblnext "LAYER")) );while (if (=(substr(setq curdwg(getvar"dwgname"))2 1)":") (progn (setq cdstrl(strlen curdwg)) (while (not(or(=(substr curdwg(1- cdstrl)1)"\\")(=(substr curdwg(1- cdstrl)1)"/"))) (setq cdstrl(1- cdstrl)) );while (setq curdwg(strcase(substr curdwg cdstrl))) );progn );if (cond ((and (=(substr curdwg 1 3)(strcat(substr(getvar"dwgprefix")4 2)"-")) (>=(strlen curdwg)6)) (setq fnsufx(strcat(substr curdwg 4 1)(substr curdwg 6)))) ((=(strlen curdwg)8) (setq fnsufx(strcat(substr curdwg 1 2)(substr curdwg 5 1)(substr curdwg 7)))) ((>=(strlen curdwg)6) (setq fnsufx(strcat(substr curdwg 1 5)))) ((<(strlen curdwg)6) (setq fnsufx curdwg)) );cond (setq invscr(open(strcat(getvar"dwgprefix")"inv" fnsufx ".scr")"w")) (setq rstscr(open(strcat(getvar"dwgprefix")"rst" fnsufx ".scr")"w")) ; (setq svwfnm(open(strcat (getvar"dwgname") ".svw")"a")) (write-line "(setvar \"expert\" 3)" invscr) (write-line "Layer" invscr) ; (initget 1) ; (setq vname (getstring "\nSaved View Name: ")) ; (initget 128) ;; (setq vdesc (getstring (strcat"\nDescription for " vname ": "))) ; (setq vdesc (ustr 1 (strcat"\nDescription for " vname ": ")"" T)) ; (write-line (strcat "*" vname) svwfnm) ; (write-line (strcat "*" vdesc) svwfnm) ; (write-line "Layer" svwfnm) (write-line "Layer" rstscr) (foreach n onlst ; (if(eq n(getvar"clayer")) ; (write-line (strcat "off " n " y") invscr) (write-line (strcat "off " n) invscr) ; );if (write-line (strcat "on " n) rstscr) ; (write-line (strcat "on " n) svwfnm) );foreach (foreach n offlst (write-line (strcat "on " n) invscr) ; (if(eq n(getvar"clayer")) ; (write-line (strcat "off " n " y") rstscr) (write-line (strcat "off " n) rstscr) ; (write-line (strcat "off " n) svwfnm) ; );if );foreach (foreach n thwlst (write-line (strcat "thaw " n) rstscr) ; (write-line (strcat "thaw " n) svwfnm) );foreach (foreach n frzlst (write-line (strcat "thaw " n) invscr) (write-line (strcat "freeze " n) rstscr) ; (write-line (strcat "freeze " n) svwfnm) );foreach (write-line "" invscr) (write-line "" rstscr) ; (write-line "" svwfnm) (write-line (strcat"(setvar \"expert\" " (itoa exprt) ")") invscr) (close invscr) (close rstscr) ; (close svwfnm) (command ".script" (strcat"inv" fnsufx)) (setvar "expert" exprt) );defun (defun c:rstdisp () (command ".script" (strcat"rst" fnsufx)) );defun (princ)