AutoLisp-how to get current layer name ?

Can anyone tell me how to get the current layer name using Autolisp?
I am writting a little AutoLisp program that first saves the
users current layer name, then resets the layer to a different name and then does various things. Then I want to reset the layer the user had when the program was run. I know how to set a layer to a particular name, just don't know how to get the current layer name. Thanks Jarvis
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
jarvis wrote:

(getvar "CELAYER")
.........I think. It's just the variable name. I'm almost sure it's either CELAYER or CLAYER.
You can use getvar to check, even.
Command: getvar ? *layer*
Will list all variables with "layer" in their name.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
jarvis wrote:

(getvar "CELAYER")
....or "CLAYER".........I forget which.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Thnaks guys, I spent 2 hours trying to find this. Jarvis
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Hi

Well the rest of us, type Setvar ansver ? hit enter twice and look thru page after page of most all system var's with this feeling ; "what was the bloody name for that var! ;)) Then somtimes Atomsfamily is needed to check "what's the name of that bloody function". P.C. http://www.designcommunity.com/scrapbook/2660.html
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.