alanjt Posted May 13, 2010 Posted May 13, 2010 Entmod freezing current layer example: (defun c:FreezeCurrent nil ((lambda (la) (entmod (subst (cons 70 1) (assoc 70 la) la))) (entget (tblobjname "layer" (getvar 'clayer))) ) (princ) ) Quote
alanjt Posted May 13, 2010 Posted May 13, 2010 or Toggle, just for fun... (defun c:Tog nil ((lambda (la) (entmod (subst (cons 70 (abs (1- (cdr (assoc 70 la))))) (assoc 70 la) la))) (entget (tblobjname "layer" (getvar 'clayer))) ) (princ) ) Quote
Lee Mac Posted May 13, 2010 Posted May 13, 2010 Bear in mind those assume no other bits are set... Perhaps better to use a boole check: ;; Freeze/Thaw Layer ~ Lee Mac ;; layer - layer table object (tblobjname) ;; freeze - 1 = Freeze Layer ;; 0 = Thaw Layer (defun FTLayer ( layer freeze / dx70 el ) (setq dx70 (cdr (assoc 70 (setq el (entget layer))))) (entmod (subst (cons 70 (boole (+ 4 (* freeze 3)) 1 dx70)) (assoc 70 el) el))) Quote
alanjt Posted May 13, 2010 Posted May 13, 2010 Bear in mind those assume no other bits are set... Perhaps better to use a boole check: Yeah, I know (ergo the reason I said for fun.:wink:). However, I was under the impression that the 70 code for layers was only 1 or 0. Granted, time could alter something. Good point regardless. Quote
Lee Mac Posted May 13, 2010 Posted May 13, 2010 No worries http://autodesk.com/techpubs/autocad/acad2000/dxf/layer_dxf_04.htm Quote
alanjt Posted May 13, 2010 Posted May 13, 2010 No worries http://autodesk.com/techpubs/autocad/acad2000/dxf/layer_dxf_04.htm Damn. I happily stand corrected. I think it's time to dust off those oldies and do a little revising. Quote
MC5fan1968 Posted January 29, 2021 Posted January 29, 2021 LeeMac, How do I alter your .lsp to do what I want it to? You mentioned wildcards..... Quote
BIGAL Posted January 29, 2021 Posted January 29, 2021 (edited) If you were running manually -LA F cable* Enter This would freeze all layers that start their name with cable SSget supports *, *line will find lines plines etc. I am not sure which code version your running as there are a few posts, and this post was from 2010. Edited January 29, 2021 by BIGAL 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.