freddy0663 Posted January 28, 2013 Posted January 28, 2013 I'm new to the the forum... and have been searching to find a lisp routine that will freeze all layers on model space (no paper space), except current, and restore previous state (no thaw all layers), Sorry for my english Thanks in advance Quote
Tharwat Posted January 28, 2013 Posted January 28, 2013 put this in the command line and hit enter . (command "_.-layer" "freeze" "*" "") Quote
Tiger Posted January 28, 2013 Posted January 28, 2013 how about the command LAYISO and then LAYUNISO to restore? Quote
BlackBox Posted January 28, 2013 Posted January 28, 2013 I'm new to the the forum... and have been searching to find a lisp routine that will freeze all layers on model space (no paper space), except current, and restore previous state (no thaw all layers) Firstly, welcome to CADTutor, freddy0663. Methinks you are confusing Layers with Entities... Entities exist in Model and Paper (Layout) Space, whereas Layer exist within the Layer Collection/Dictionary Object (within the Drawing's Database), and not on a 'tab' per-se. Quote
freddy0663 Posted January 28, 2013 Author Posted January 28, 2013 Introduction.. Sorry, i studied france language on school. And help me for english language with internet translator (lucky), and drag and drop from another thread. However this problem no stop me. I like too mutch Lisp code and Autocad program. I use routine of Lee Mac, called Fa.lsp (since 2010) attached below. First command freeze all layer except current, second command thaw all layer. I search similar lisp to restore same previuos state of layers ( certain layers must be freeze like before) Thanks Freeze_Thaw_All.lsp Quote
freddy0663 Posted January 28, 2013 Author Posted January 28, 2013 To ad i work very mutch change of state layers, so i need a lisp for fast job. Quote
Lee Mac Posted January 28, 2013 Posted January 28, 2013 Try these two commands: (defun c:frz ( / d n ) (while (setq d (tblnext "LAYER" (null d))) (if (and (zerop (logand 1 (cdr (assoc 70 d)))) (not (member (setq n (cdr (assoc 2 d))) *thaw-list*)) ) (setq *thaw-list* (cons n *thaw-list*)) ) ) (command "_.-layer" "_F" "*" "") (princ) ) (defun c:unfrz ( ) (if *thaw-list* (command "_.-layer" "_T" (apply 'strcat (mapcar '(lambda ( x ) (strcat "," x)) *thaw-list*)) "" ) ) (setq *thaw-list* nil) (princ) ) Type frz to freeze all layers except the current layer and unfrz to restore the previous state. Quote
freddy0663 Posted January 28, 2013 Author Posted January 28, 2013 Thank mr Lee Work perfect. Very appreciation. Forever thanks for all Quote
freddy0663 Posted January 28, 2013 Author Posted January 28, 2013 Sorry My best thanks to all of you. Quote
tomazzlender Posted June 6, 2013 Posted June 6, 2013 Try these two commands: (defun c:frz ( / d n ) (while (setq d (tblnext "LAYER" (null d))) (if (and (zerop (logand 1 (cdr (assoc 70 d)))) (not (member (setq n (cdr (assoc 2 d))) *thaw-list*)) ) (setq *thaw-list* (cons n *thaw-list*)) ) ) (command "_.-layer" "_F" "*" "") (princ) ) (defun c:unfrz ( ) (if *thaw-list* (command "_.-layer" "_T" (apply 'strcat (mapcar '(lambda ( x ) (strcat "," x)) *thaw-list*)) "" ) ) (setq *thaw-list* nil) (princ) ) Type frz to freeze all layers except the current layer and unfrz to restore the previous state. Hi Lee! Thank you for this tip. I find it extremely useful. I noticed that I can only use it if I copy it in command line in autocad. I have to do this every time I open a file. What can I do to permanently store this two commands in autocad? I use Autocad 2013 for Mac. Thank you! Regards, Tomaž Quote
Lee Mac Posted June 6, 2013 Posted June 6, 2013 Hi Tomaž, Welcome to CADTutor and thank you, I'm glad you find the programs useful. In response to your questions: open notepad (or the Mac equivalent of a plain text editor) and copy/paste the code into the editor. Save the file with an arbitrary filename, but with a .lsp file extension (ensure 'Save as Type' is set to 'All Files', or whatever the equivalent is on a Mac) Then, follow my tutorials for information regarding loading & automatic loading: How to Run an AutoLISP Program Loading Programs Automatically Quote
JayDee0414 Posted June 7, 2013 Posted June 7, 2013 I'm new to the the forum... and have been searching to find a lisp routine that will freeze all layers on model space (no paper space), except current, and restore previous state (no thaw all layers), Sorry for my english Thanks in advance If you set EXPERT=0 your lisp works fine. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.