MiGo Posted March 27, 2009 Share Posted March 27, 2009 I am working on a script and hit a little bump. At a point I want to unlock all layers where the objects are selectable (layers unfrozen and turned on). If I have the script initiate the layer command then there is the select options list and "u" is for unlock. It then wants a layer name or return to select items. Here is where the problem is when i'm in control I can just hit return to select the items and just select all, but when the script is running it skips my space for a return and goes to the next all statement and errors saying not a valid option. Is there a way to force that return to select the objects? Quote Link to comment Share on other sites More sharing options...
lpseifert Posted March 27, 2009 Share Posted March 27, 2009 maybe? -layer u * Quote Link to comment Share on other sites More sharing options...
MiGo Posted March 27, 2009 Author Share Posted March 27, 2009 Thanks, but that unlocks all layers, but I have come to the realization that if a layer is locked and turned off then the objects will still not be selectable, so unlocking all layers will work. Thanks helping me come to that realization. Quote Link to comment Share on other sites More sharing options...
alanjt Posted March 30, 2009 Share Posted March 30, 2009 just add a little to lpseifert's code: -layer unlock * on * thaw * hell, if you aren't changing any of the layer properties from "-layer", when you reach the end of your script, you can just issue: layerp Quote Link to comment Share on other sites More sharing options...
Androw Posted June 26, 2012 Share Posted June 26, 2012 (edited) ; Andreas Behnk Juni 2012 ; Klafs GmbH & CO KG ; abrufen und entsperren aller Layer einer DWG in Klassik Lisp (defun Layer:entsperren (/ erster zugriff layerliste i) (setq erster T i 0) ; für den ersten Layer (setq zugriff (tblnext "layer" erster)) (setq layerliste (cons (cdr (assoc 2 zugriff)) layerliste)) (setq erster NIL) ; damit werden alle anderen Layer gelesen (while (setq zugriff (tblnext "layer" erster)) (setq layerliste (cons (cdr (assoc 2 zugriff)) layerliste)) ; füllt die Layer Liste ) (repeat (length layerliste) (command "-layer" "EN" (nth i layerliste) "") ; entsperrt einen Layer i (setq i (+ 1 i)) ) ) ; defun Edited July 29, 2015 by rkmcswain added [CODE] tags Quote Link to comment Share on other sites More sharing options...
Vignatus Posted May 24, 2015 Share Posted May 24, 2015 If you are too lazy to type "-layer" command and unlock every time, then this will work. Create a lisp file and paste this. (defun C:LAYULKALL () (command "_layer" "u" "*" "") (princ "\nLAYULKALL\nAll layers have been unlocked.") (princ) ) (princ "\nUse LAYULKALL to unlock all layers") (princ) Load the lisp in CAD and issue "LAYULKALL" at command line. Quote Link to comment Share on other sites More sharing options...
jroth Posted July 29, 2015 Share Posted July 29, 2015 If you are too lazy to type "-layer" command and unlock every time, then this will work.Create a lisp file and paste this. (defun C:LAYULKALL () (command "_layer" "u" "*" "") (princ "\nLAYULKALL\nAll layers have been unlocked.") (princ) ) (princ "\nUse LAYULKALL to unlock all layers") (princ) Load the lisp in CAD and issue "LAYULKALL" at command line. Worked Perfectly Quote Link to comment Share on other sites More sharing options...
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.