Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Contributor
ADISdfox
Posts: 22
Registered: ‎05-24-2010
Message 1 of 9 (8,261 Views)
Accepted Solution

Unlock ALL layers

8261 Views, 8 Replies
01-19-2011 06:33 AM

Anyone have a code that will unlock ALL layers. Similar to the thaw or turn on ALL layers buttons?

I'm running a full version of 2011.

 

Thanks,

Dave Fox


ADISdfox wrote:

Here is what 2011 says for the Thaw all layers ^C^C_laythw. Now there is a button that will unlock the selected layer and that is ^C^C_layulk, but that doesn't unlock all layers. It will only allow you to unlock 1 at a time.


So there are "specialized" Thawing and On-ing command names for doing all Layers [they're in the Express Tools for me back in 2004, but I don't have toolbar buttons for them, so I forgot they were there -- I've had equivalents in pull-down and tablet menus since long before they existed as Express Tools].  It seems the equivalent ones for Off and Freeze and Lock, like that for Unlock, also work by user selection, one at a time, rather than doing all Layers.  The difference would be that for a Layer the User wants turned On or Thawed, they can't select an object, because objects on such a Layer won't be visible to select, so the commands do all Layers for those two options.

 

For what you want, you'll need to use the generic Layer command and its Unlock option, with the asterisk representing all Layers:

 

^C^C_.-layer _unlock * ;

 

[You could make similar do-it-to-all-Layers buttons for the Off and Freeze and Lock options, but those would not be things I would expect anyone to have any use for.]

*Expert Elite*
Kent1Cooper
Posts: 5,795
Registered: ‎09-13-2004
Message 2 of 9 (8,248 Views)

Re: Unlock ALL layers

01-19-2011 08:26 AM in reply to: ADISdfox

ADISdfox wrote:

Anyone have a code that will unlock ALL layers. Similar to the thaw or turn on ALL layers buttons?

I'm running a full version of 2011.

 

Thanks,

Dave Fox


I don't have 2011, but I imagine the contents of those buttons is probably something like this:

 

^C^C_.-layer _thaw * ;

^C^C_.-layer _on * ;

 

[They may or may not have the _ or . prefixes on things, and they're not case-sensitive.]  If so, you could make one like this:

 

^C^C_.layer _unlock * ;

 

If such button macro things are still similarly structured, right-click on one of those Thaw-All or On-All buttons, and pick Customize... at the bottom of the list.  Then with the Customize window up, click again on the button, and what it invokes will be in the "Macro associated with this button:" area.  Copy that, change the _thaw or _t or _on or whatever to _unlock or just _u, and assign the adjusted line to a new button.  On the Commands tab in the Customize window, pick User defined, and in the right area, grab User Defined Button and drag it into a Toolbar.  Then pick on that new space and you can paste the code in, give it a name and description, edit the button appearance, etc.

Kent Cooper
Contributor
ADISdfox
Posts: 22
Registered: ‎05-24-2010
Message 3 of 9 (8,240 Views)

Re: Unlock ALL layers

01-19-2011 10:21 AM in reply to: ADISdfox

Here is what 2011 says for the Thaw all layers ^C^C_laythw. Now there is a button that will unlock the selected layer and that is ^C^C_layulk, but that doesn't unlock all layers. It will only allow you to unlock 1 at a time.

*Expert Elite*
Kent1Cooper
Posts: 5,795
Registered: ‎09-13-2004
Message 4 of 9 (8,236 Views)

Re: Unlock ALL layers

01-19-2011 11:45 AM in reply to: ADISdfox

ADISdfox wrote:

Here is what 2011 says for the Thaw all layers ^C^C_laythw. Now there is a button that will unlock the selected layer and that is ^C^C_layulk, but that doesn't unlock all layers. It will only allow you to unlock 1 at a time.


So there are "specialized" Thawing and On-ing command names for doing all Layers [they're in the Express Tools for me back in 2004, but I don't have toolbar buttons for them, so I forgot they were there -- I've had equivalents in pull-down and tablet menus since long before they existed as Express Tools].  It seems the equivalent ones for Off and Freeze and Lock, like that for Unlock, also work by user selection, one at a time, rather than doing all Layers.  The difference would be that for a Layer the User wants turned On or Thawed, they can't select an object, because objects on such a Layer won't be visible to select, so the commands do all Layers for those two options.

 

For what you want, you'll need to use the generic Layer command and its Unlock option, with the asterisk representing all Layers:

 

^C^C_.-layer _unlock * ;

 

[You could make similar do-it-to-all-Layers buttons for the Off and Freeze and Lock options, but those would not be things I would expect anyone to have any use for.]

Kent Cooper
Contributor
ADISdfox
Posts: 22
Registered: ‎05-24-2010
Message 5 of 9 (8,229 Views)

Re: Unlock ALL layers

01-19-2011 12:57 PM in reply to: ADISdfox

Enter name list of layer(s) to unlock or <select objects>: * Enter an option
[?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Fre
eze/Thaw/LOck/Unlock/stAte/Description/rEconcile]:

This is what I get.

OK here's the weird thing. It works, but I hit the icon, it shows the above, I select "U", it says "Layer, Layer Unlock GROUP" ,then displays the default "Command:" on the command line, but the layers are not unlocked until I hit the icon again. Also if I select any of the other options (LO for lock) it takes me to the standard command as if I entered LO in the deafult command line. Same with TR, T, D, etc. A minor inconveinence. Any ideas as to why?

 

Here's another glitch. If I execute the command and select L the line command comes up. I draw a line and all of my layers are unlocked.

*Expert Elite*
Kent1Cooper
Posts: 5,795
Registered: ‎09-13-2004
Message 6 of 9 (8,214 Views)

Re: Unlock ALL layers

01-19-2011 01:34 PM in reply to: ADISdfox

ADISdfox wrote:

Enter name list of layer(s) to unlock or <select objects>: * Enter an option
[?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Fre
eze/Thaw/LOck/Unlock/stAte/Description/rEconcile]:

This is what I get.

OK here's the weird thing. It works, but I hit the icon, it shows the above, I select "U", it says "Layer, Layer Unlock GROUP" ,then displays the default "Command:" on the command line, but the layers are not unlocked until I hit the icon again. Also if I select any of the other options (LO for lock) it takes me to the standard command as if I entered LO in the deafult command line. Same with TR, T, D, etc. A minor inconveinence. Any ideas as to why?

 

Here's another glitch. If I execute the command and select L the line command comes up. I draw a line and all of my layers are unlocked.


Does it really not return you to the Command: prompt [at the point where you have "This is what I get"], the first time?  And does it really not unlock Layers?  [It works for me, copied/pasted right from Message 4 into a new user-defined button.]

 

It looks like the "U" you give it is being taken as undo, not as the Unlock option in Layer, because that business with GROUP at the end is just what I would expect from undoing a menu item.  But that would only happen on entering U at the Command: prompt, even if somehow that's not actually appearing for you.  [That would also explain why you get the Line command if you give it "L" -- it would require the Command: prompt to be waiting there, whether seen or unseen.]  And if that's the case, of course the Layers would no longer be unlocked if you undo the menu item, but were they unlocked by the button?  Pick the button and immediately check the Layer listing without giving it a "U" [or anything else], to see whether they've actually been unlocked. 

One possibility:  check the "Macro associated with this button:" area in Customize for that button, and make sure the semicolon is really the last thing in there, that is, it doesn't have any additional space(s) or Enter(s) somehow pasted in that you can't see, going past the semicolon or on to another line.  Unlike the way it works in Lisp, in a macro every character counts and is processed, including spaces.

Kent Cooper
Contributor
ADISdfox
Posts: 22
Registered: ‎05-24-2010
Message 7 of 9 (8,182 Views)

Re: Unlock ALL layers

01-20-2011 05:55 AM in reply to: ADISdfox

You are correct. Once I hit the button all layers are unlocked.

New Member
segunopadeji
Posts: 2
Registered: ‎02-17-2014
Message 8 of 9 (2,370 Views)

Re: Unlock ALL layers

02-17-2014 11:36 PM in reply to: ADISdfox

to unlock all layers at once. Not one at a time but ALL LAYERS AT ONCE.

  • open the layer properties table or type LAYER. then enter
  • inside the layer properties table, highlight all the layers OR click on one layer and press CTRL A to highlight all at once.
  • then click on one unlock icon AND EVERYTHING UNLOCKS
  • works for LOCK, FREEZE and LAYER ON.
  • Good Luck.

 

*Expert Elite*
pbejse
Posts: 2,502
Registered: ‎11-24-2009
Message 9 of 9 (2,361 Views)

Re: Unlock ALL layers

02-18-2014 01:24 AM in reply to: segunopadeji

segunopadeji wrote:

to unlock all layers at once. Not one at a time but ALL LAYERS AT ONCE.

  • open the layer properties table or type LAYER. then enter
  • inside the layer properties table, highlight all the layers OR click on one layer and press CTRL A to highlight all at once.
  • then click on one unlock icon AND EVERYTHING UNLOCKS
  • works for LOCK, FREEZE and LAYER ON.
  • Good Luck.

 


Is there a question there? 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!