Message 1 of 6

Not applicable
06-28-2016
06:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everybody,
In some of my functions evolving layouts I had to create a way of freezing all layers so AutoCad runned more smoothly.
The following two functions i use in the beginning and ending of other routines so they run faster but I'm having a very strange behavior:
(defun freezeall () (setq cLay(tblnext "LAYER" T)) (setq listagemparavoltar nil) (while cLay (if (= (cdr(assoc 2 cLay)) (getvar "CLAYER")) ;;;Is cLay Current Layer?;;;; (setq cLay(tblnext "LAYER")) ;;;If true;;;; (progn ;;;If false start;;;; (SETQ listagemparavoltar (cons (list (assoc 2 cLay) (assoc 70 (entget (tblobjname "LAYER" (cdr(assoc 2 cLay)))))) listagemparavoltar)) (entmod (SUBST (CONS 70 1) (assoc 70 (entget (tblobjname "LAYER" (cdr(assoc 2 cLay))))) (entget (tblobjname "LAYER" (cdr(assoc 2 cLay)))) ) ) (setq cLay(tblnext "LAYER")) ) ;;;If false end;;;; ) ;;;End If;;;; ) ;;;End while;;;; )
(defun thawlayers () (foreach n listagemparavoltar (if (= (type n) 'list) (entmod (SUBST (Car (cdr n)) (assoc 70 (entget (tblobjname "LAYER" (cdr (car n))))) (entget (tblobjname "LAYER" (cdr (car n)))) ) ) ) ) )
It happens that the layers remain occult and they only reappear if I do "regenall" (manually, I tried doing it on Lisp but doest seem to have efect) on every layout, including modelspace.
Tank you very much for your help.
Marcos.
Solved! Go to Solution.