marmo Posted July 29, 2010 Author Share Posted July 29, 2010 taking pieces of code from the internet without understanding how they work is simplistic. Marco Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 30, 2010 Share Posted July 30, 2010 taking pieces of code from the internet without understanding how they work is simplistic.Marco And taking them without a simple 'thank you' is disrespectful. Quote Link to comment Share on other sites More sharing options...
marmo Posted July 30, 2010 Author Share Posted July 30, 2010 Hi, for a simple 'thank you' see post n°13. I'm kidding... Now i'm going to study lisp:sweat:. I'm serious... :) Marco Quote Link to comment Share on other sites More sharing options...
Se7en Posted July 30, 2010 Share Posted July 30, 2010 Hello,I read the post quickly:P, I took the code that works and I thank those who posted:D. Greetings all, Marco Nice. *lamo* ............. Quote Link to comment Share on other sites More sharing options...
Se7en Posted July 30, 2010 Share Posted July 30, 2010 So you have no intention to learn? John obviously put a lot of time into his answer to benefit your learning, surely the least you could do was study his code. its cool. I get that a lot because i dont give people the answer outright. I try to teach not give code away. Quote Link to comment Share on other sites More sharing options...
mostlynice Posted June 18, 2013 Share Posted June 18, 2013 Hi, Is there a variable of this I can have and put into my acad pgp to unlock all layers upon open? Have a colleague who uses locked layers as layer off and doesn't respect layer locking. cheers Quote Link to comment Share on other sites More sharing options...
ReMark Posted June 18, 2013 Share Posted June 18, 2013 Wouldn't it be better, if there was a variable, to use it in a snippet of lisp and put this in one's acaddoc.lsp file? You can find at least three ways to unlock all layers in this thread... http://www.cadtutor.net/forum/showthread.php?50859-unlock-all-layers Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 18, 2013 Share Posted June 18, 2013 Hi, Is there a variable of this I can have and put into my acad pgp to unlock all layers upon open? Have a colleague who uses locked layers as layer off and doesn't respect layer locking. cheers You can't put the code in your pgp file (not what it's for), but you can put a bit of code in your startup file (acaddoc.lsp, etc.). Remark has posted a nice link to what you need. Quote Link to comment Share on other sites More sharing options...
segunopadeji Posted February 18, 2014 Share Posted February 18, 2014 to unlock all layers in one click. Not one layer at a time but ALL LAYERS AT ONCE. 1. open the layer properties table or type LAYER. then enter 2. inside the layer properties table, highlight all the layers OR click on one layer and press CTRL A to highlight all at once. 3. then click on one unlock icon AND EVERYTHING UNLOCKS works for LOCK, FREEZE and LAYER ON. Good Luck. Quote Link to comment Share on other sites More sharing options...
Happy Hobbit Posted March 9, 2016 Share Posted March 9, 2016 Old post I know but wouldn't simply (command "-layer" "U" "*" "") do it? Quote Link to comment Share on other sites More sharing options...
tive29 Posted May 23, 2017 Share Posted May 23, 2017 How to run this lisp without the ()? example: c:unlockall instead of (gc:LayerUnLockAll T) c:lockprevious instead of (gc:LayerUnLockAll nil) Hi, Here's a method using defun-q to store the unlocked layers list within the function so that they can be relocked by calling the same function. Using (gc:LayerUnLockAll T) unlock all locked layers and store them in a list within the function (gc:LayerUnLockAll nil) relock previously unlocked layers stored in the function. ;;; gc:LayerUnLockAll (gile) ;;; Unlock all layers or relock prevously locked layers ;;; ;;; Argument : T or nil ;;; ;;; Using : ;;; (gc:LayerUnLockAll T) unlock all locked layers ;;; (gc:LayerUnLockAll nil) relock previously unlocked layers (vl-load-com) (defun-q gc:layerunlockall (flag / lst lay) (setq lst nil) (if flag (vlax-for l (vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object))) (and (= (vla-get-Lock l) :vlax-true) (setq lst (cons l lst)) (vla-put-Lock l :vlax-false) ) ) (progn (foreach n lst (vl-catch-all-apply 'vla-put-Lock (list n :vlax-true)) ) (setq lst nil) ) ) (setq gc:layerunlockall (cons (car gc:layerunlockall) (cons (list 'setq 'lst (list 'quote lst)) (cddr gc:layerunlockall) ) ) ) lst ) Quote Link to comment Share on other sites More sharing options...
gile Posted May 23, 2017 Share Posted May 23, 2017 Hi, You can simply do: (defun c:unlockall () (gc:layerunlockall T) (princ)) (defun c:lockprevious () (gc:layerunlockall nil) (princ)) Quote Link to comment Share on other sites More sharing options...
tive29 Posted May 24, 2017 Share Posted May 24, 2017 Thanks gile Hi, You can simply do: (defun c:unlockall () (gc:layerunlockall T) (princ)) (defun c:lockprevious () (gc:layerunlockall nil) (princ)) 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.