<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: changing layer shortcut in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8791091#M143873</link>
    <description>&lt;P&gt;Thank you, I will try this. I didn't try your lisp, because I tried the other one first and it worked fine. Should it work when plugging into a macro like the other one? Not sure how that works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
    <pubDate>Tue, 14 May 2019 21:01:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-05-14T21:01:44Z</dc:date>
    <item>
      <title>changing layer shortcut</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711241#M143865</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have been spending a lot of time today researching methods to increase productivity and efficiency and I came across a command ('_-LAYER;_Set;mylayer1;;)&amp;nbsp;to set current layer and put our most used to ctrl+1, ctrl+2... etc. This is super helpful, but I am curious about if there is a command to mimic the action of selecting the a layer from the drop down menu. The way it functions, of course, is when there is no objects selected, it will switch the current layer; when there is any objects selected it will change the layer property of the object(s). I want a command that will do this. Anyone know a replacement command?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 19:20:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711241#M143865</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-05T19:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: changing layer shortcut</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711320#M143866</link>
      <description>&lt;P&gt;Are you looking for the "laymakecurrent" command?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 19:59:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711320#M143866</guid>
      <dc:creator>s.borello</dc:creator>
      <dc:date>2019-04-05T19:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: changing layer shortcut</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711524#M143867</link>
      <description>&lt;P&gt;Try this LISP as your macro... unless you don't run LT...&lt;/P&gt;
&lt;PRE&gt;(if (ssget "_I") (command "_chprop" "_layer" "mylayer" "") (command "_layer" "_m" "mylayer" ""))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 21:51:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711524#M143867</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-04-05T21:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: changing layer shortcut</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711560#M143868</link>
      <description>&lt;P&gt;You can save this to a lisp file and place in it in the start-up suite.&lt;/P&gt;
&lt;P&gt;Command LL will allow to to select an object and set that layer current.&lt;/P&gt;
&lt;P&gt;Command CUR will allow you to change objects to the current layer.&lt;/P&gt;
&lt;P&gt;I've used these commands for over 20 years and couldn't live without.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;BR /&gt;(DEFUN C:LL (/ e n)&lt;BR /&gt;(setq e (car (entsel "\nTo which would like the layer set..:")))&lt;BR /&gt;(if e&lt;BR /&gt;(progn&lt;BR /&gt;(setq e (entget e))&lt;BR /&gt;(setq n (cdr (assoc 8 e)))&lt;BR /&gt;(COMMAND "LAYER" "S" n "")&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ (strcat "\nI'll be doggone,.... you did it!!!: "n))&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;BR /&gt;;;; THE FOLLOWING LISP WILL CHANGE A SELECTED ENTITY TO THE CURRENT LAYER.&lt;BR /&gt;(DEFUN C:CUR (/ SS DL)&lt;BR /&gt;(setq e (car (entsel "\nPick entities you want changed to the current layer !!:")))&lt;BR /&gt;(setvar "cmdecho" 0)&lt;BR /&gt;(SETQ SS (SSGET))&lt;BR /&gt;(SETQ DL (GETVAR "CLAYER"))&lt;BR /&gt;(COMMAND ".CHPROP" SS "" "LA" DL"" )&lt;BR /&gt;(PROMPT "Cool, Entities changed to current layer ") &lt;BR /&gt;(EVAL DL)&lt;BR /&gt;) &lt;BR /&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 22:28:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711560#M143868</guid>
      <dc:creator>leothebuilder</dc:creator>
      <dc:date>2019-04-05T22:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: changing layer shortcut</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711918#M143869</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp; hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;post your most used layer list cause i have a beautiful solution for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;moshe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2019 11:10:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711918#M143869</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2019-04-06T11:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: changing layer shortcut</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711966#M143870</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... when there is no objects selected, it will switch the current layer; when there is any objects selected it will change the layer property of the object(s). ….&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's what I use for exactly that in relation to Layer 0.&amp;nbsp; You can make others and substitute any other Layer name.&lt;/P&gt;
&lt;PRE&gt;(defun C:L0 ()
  ; put pre-selected object(s) [if any] on Layer 0, otherwise set current Layer to 0
  (if (ssget "_I")
    (command "_.chprop" "_layer" "0" ""); then
    (command "_.layer" "_thaw" "0" "_set" "0" ""); else
  ); if
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;[&lt;FONT color="#ff6600"&gt;EDITED&lt;/FONT&gt; -- the first version was written for an older version, but doesn't work right in newer ones, and this is now the same as &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;'s version, except that mine will not have a problem if the Layer exists but is frozen.]&amp;nbsp; Since Layer 0 always exists, this doesn't need to account for it possibly not existing.&amp;nbsp; For other Layer names, you could substitute &lt;FONT color="#000000"&gt;"_make"&lt;/FONT&gt; in place of &lt;FONT color="#000000"&gt;"_set"&lt;/FONT&gt; in the second (command), but for the first one, more would need to be done.&amp;nbsp; If that's needed, a question arises:&amp;nbsp; Would you want it to merely put the selected objects on that Layer &lt;EM&gt;without making that Layer current&lt;/EM&gt;, or would you also want it made current?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#ff6600"&gt;FURTHER EDIT:&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp; It occurs to me that rather than defining &lt;EM&gt;separate commands&lt;/EM&gt;&amp;nbsp; for each Layer you might want to do this with, you can define a&lt;EM&gt; function&lt;/EM&gt;&amp;nbsp; with an &lt;EM&gt;&lt;FONT color="#0000ff"&gt;argument&lt;/FONT&gt;:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun dolayer (&lt;FONT color="#0000ff"&gt;layname&lt;/FONT&gt;)
  ; put pre-selected object(s) [if any] on specified Layer, otherwise set that Layer current
  (if (ssget "_I")
    (command "_.chprop" "_layer" &lt;FONT color="#0000ff"&gt;layname&lt;/FONT&gt; ""); then
    (command "_.layer" "_thaw" &lt;FONT color="#0000ff"&gt;layname&lt;/FONT&gt; "_set" &lt;FONT color="#0000ff"&gt;layname&lt;/FONT&gt; ""); else
  ); if
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;That way, you can put simpler entries into Tool Palette items, or other menu items:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;(dolayer "0")&lt;/FONT&gt;&lt;FONT color="#33cccc"&gt;&lt;EM&gt;; equivalent to my first routine above&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;(dolayer "GeorgeClooney")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;(dolayer "MarieAntoinette")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2019 12:28:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8711966#M143870</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-04-06T12:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: changing layer shortcut</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8790440#M143871</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Thanks again for the great macro(or LISP?)! I'm wondering if you can help me add to it the function to keep the selection after completing the command. For example: selecting some objects, activating the command to change their layer and the objects stay selected. This would be real handy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 16:14:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8790440#M143871</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-14T16:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: changing layer shortcut</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8790818#M143872</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;add to it the function to keep the selection after completing the command. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basing it on my variant:&lt;/P&gt;
&lt;PRE&gt;(defun C:L&lt;STRONG&gt;&lt;FONT color="#00ccff"&gt;TheLayerName&lt;/FONT&gt;&lt;/STRONG&gt; (&lt;FONT color="#0000ff"&gt;/ ss&lt;/FONT&gt;)
  &lt;FONT color="#999999"&gt;; put pre-selected object(s) [if any] on Layer &lt;FONT color="#0000ff"&gt;and highlight&lt;/FONT&gt;, otherwise set current&lt;/FONT&gt;
  (if &lt;FONT color="#0000ff"&gt;(setq ss&lt;/FONT&gt; (ssget "_I")&lt;FONT color="#0000ff"&gt;)&lt;/FONT&gt;&lt;BR /&gt;    &lt;FONT color="#0000ff"&gt;(progn&lt;/FONT&gt; &lt;FONT color="#999999"&gt;; then&lt;/FONT&gt;
      (command "_.chprop" "_layer" "&lt;EM&gt;&lt;FONT color="#00ccff"&gt;TheLayerName&lt;/FONT&gt;&lt;/EM&gt;" "")&lt;BR /&gt;      &lt;FONT color="#0000ff"&gt;(sssetfirst nil ss)&lt;FONT color="#999999"&gt;; select/grip/highlight&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;    &lt;FONT color="#0000ff"&gt;)&lt;/FONT&gt;&lt;FONT color="#999999"&gt;; progn&lt;/FONT&gt;
    (command "_.layer" "_thaw" "&lt;EM&gt;&lt;FONT color="#00ccff"&gt;TheLayerName&lt;/FONT&gt;&lt;/EM&gt;" "_&lt;FONT color="#0000ff"&gt;make&lt;/FONT&gt;" "&lt;EM&gt;&lt;FONT color="#00ccff"&gt;TheLayerName&lt;/FONT&gt;&lt;/EM&gt;" "")&lt;FONT color="#999999"&gt;; else
&lt;/FONT&gt;  )&lt;FONT color="#999999"&gt;; if
&lt;/FONT&gt;  (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 May 2019 18:49:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8790818#M143872</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-05-14T18:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: changing layer shortcut</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8791091#M143873</link>
      <description>&lt;P&gt;Thank you, I will try this. I didn't try your lisp, because I tried the other one first and it worked fine. Should it work when plugging into a macro like the other one? Not sure how that works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 21:01:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8791091#M143873</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-14T21:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: changing layer shortcut</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8791382#M143874</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... Should it work when plugging into a macro like the other one? Not sure how that works. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try it!&amp;nbsp; Omit the top two lines and the bottom two lines, remove all semicolons and whatever follows one on the same line, and string the rest together.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, have it loaded as a command definition by something like acaddoc.lsp, and just put the command name in a macro button.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 02:15:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8791382#M143874</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-05-15T02:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: changing layer shortcut</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8791841#M143875</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;... I'm wondering if you can help me add to it the function to keep the selection after completing the command...&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(if (ssget "_I") (progn (command "_chprop" "_layer" "&lt;FONT color="#FF0000"&gt;mylayer&lt;/FONT&gt;" "") (sssetfirst nil (ssget "_P"))) (command "_layer" "_t"  "&lt;FONT color="#FF0000"&gt;mylayer&lt;/FONT&gt;" "_m" "&lt;FONT color="#FF0000"&gt;mylayer&lt;/FONT&gt;" ""))&lt;/PRE&gt;
&lt;P&gt;It's basically the same as Kent suggested...&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 07:51:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/changing-layer-shortcut/m-p/8791841#M143875</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-15T07:51:48Z</dc:date>
    </item>
  </channel>
</rss>

