<?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: Macro change layer in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766136#M89158</link>
    <description>&lt;P&gt;Are you on LT?&lt;/P&gt;
&lt;P&gt;I tried that and it works the same (bad) no matter where from is used.&lt;/P&gt;
&lt;P&gt;The problem is that the LAYERP returns the last change of layers properties, which can be just a color!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Think of what is actually returned by LAYERP when:&lt;/P&gt;
&lt;P&gt;- your layer does not exist&lt;/P&gt;
&lt;P&gt;- your layer does exist but not current&lt;/P&gt;
&lt;P&gt;- your layer does exist and is already current&lt;/P&gt;
&lt;P&gt;- your layer is off...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2019 07:39:25 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2019-05-02T07:39:25Z</dc:date>
    <item>
      <title>Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766081#M89157</link>
      <description>&lt;P&gt;I use this macro to make the layer active when I activate a certain command.&lt;BR /&gt;This works well if I use the icon in the ribbon.&lt;BR /&gt;But if I use the shortcut then the layer does not become active.&lt;BR /&gt;Can someone tell me why it doesn't work with the shortcut?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;^C^C-layer;m;Maatvoering;c;3;;;_dimlinear;\\\layerp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 06:55:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766081#M89157</guid>
      <dc:creator>jostroopers</dc:creator>
      <dc:date>2019-05-02T06:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766136#M89158</link>
      <description>&lt;P&gt;Are you on LT?&lt;/P&gt;
&lt;P&gt;I tried that and it works the same (bad) no matter where from is used.&lt;/P&gt;
&lt;P&gt;The problem is that the LAYERP returns the last change of layers properties, which can be just a color!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Think of what is actually returned by LAYERP when:&lt;/P&gt;
&lt;P&gt;- your layer does not exist&lt;/P&gt;
&lt;P&gt;- your layer does exist but not current&lt;/P&gt;
&lt;P&gt;- your layer does exist and is already current&lt;/P&gt;
&lt;P&gt;- your layer is off...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 07:39:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766136#M89158</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-02T07:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766223#M89159</link>
      <description>&lt;P&gt;Iam not on LT.&lt;/P&gt;
&lt;P&gt;I changed the macro and i deleted \\\layerp;&lt;/P&gt;
&lt;P&gt;But it didn't work.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 08:18:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766223#M89159</guid>
      <dc:creator>jostroopers</dc:creator>
      <dc:date>2019-05-02T08:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766241#M89160</link>
      <description>&lt;P&gt;If i use the icon, on the commandline i see _dimlinear.&lt;/P&gt;
&lt;P&gt;When i use the shortcut i see on the commandline dimlinear, no underscore.&lt;/P&gt;
&lt;P&gt;I changed the .pgp file to _dimlinear but that didn't change.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 08:28:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766241#M89160</guid>
      <dc:creator>jostroopers</dc:creator>
      <dc:date>2019-05-02T08:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766277#M89161</link>
      <description>&lt;P&gt;Don't do that. It does not matter unless you use non-english autocad.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what we can do... we could either try to search what's going on... In that case, you need to give me more information... like command line listing, record video of what you do...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;... or simply use a LISP as your macro. And because it gives you better and predictable performance I suggest to use that. Adjusting a menu-macro to similar performance would be rather challenging, possibly not possible.&lt;/P&gt;
&lt;PRE&gt;((lambda (/ l) (setq l (getvar 'clayer)) (command "_.-layer" "_t" "Maatvoering" "_m" "Maatvoering" "_c" 3 "" "") (command-s "_.dimlinear") (setvar 'clayer l) (princ)))&lt;/PRE&gt;
&lt;P&gt;Above code in a more understandable format with comments:&lt;/P&gt;
&lt;PRE&gt;((lambda (/ l)									; annonymous function
   (setq l (getvar 'clayer))							; save current layer name
   (command "_.-layer" "_t" "Maatvoering" "_m" "Maatvoering" "_c" 3 "" "")	; thaw, make new or just current, change the color in needed
   (command-s "_.dimlinear")							; run the command with as many user inputs as he needs
   (setvar 'clayer l)								; get currnt layer back
   (princ)))									; silence finish&lt;/PRE&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>Thu, 02 May 2019 08:50:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766277#M89161</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-02T08:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766320#M89162</link>
      <description>&lt;P&gt;I have made a movie so you can see what iam doing.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.screencast.com/t/eMgm3Ebf" target="_blank"&gt;https://www.screencast.com/t/eMgm3Ebf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 09:25:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766320#M89162</guid>
      <dc:creator>jostroopers</dc:creator>
      <dc:date>2019-05-02T09:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766370#M89163</link>
      <description>&lt;P&gt;Thanks. Now it's clear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Original command is named DIMLINEAR. In PGP file you can create/change an ALIAS for that. But still you'll be calling the original command.&lt;/P&gt;
&lt;P&gt;This original command is also used in RIBBON as part of a MENU-MACRO with some other&amp;nbsp;expressions around (like ^C^C). So what you did in RIBBON was changing just surroundings expressions, not the original command itself.&lt;/P&gt;
&lt;P&gt;To make it work that way you would need to UNDEFINE the original command and DEFINE a new-one by using LISP routine. It's not complicated, but t wouldn't recommend that because it's rather confusing. And also...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...since you're on 2020, why don't you simply set &lt;STRONG&gt;DIMLAYER&lt;/STRONG&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW The term "Shortcut" in AutoCAD is used of function keys combinations only (eg. Crtl+I).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 09:49:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766370#M89163</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-02T09:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766429#M89164</link>
      <description>&lt;P&gt;Strange, it works for you and in earlier versions it worked for me too.&lt;BR /&gt;Dimlayer is a good tip, but it's not for other commands such as Text or Mleader.&lt;BR /&gt;I will search further and I may use the lisp routine.&lt;BR /&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 10:22:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766429#M89164</guid>
      <dc:creator>jostroopers</dc:creator>
      <dc:date>2019-05-02T10:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766448#M89165</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/386826"&gt;@jostroopers&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Strange, it works for you and in earlier versions it worked for me too.&lt;BR /&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It worked for me as a "Shortcut", not as "Alias". You had to have some other tool for that. Older versions are no different in this behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But speaking of LISP, you can try&amp;nbsp;&lt;A href="http://www.lee-mac.com/layerdirector.html" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt;&amp;nbsp;Lee's routine.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 10:35:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766448#M89165</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-02T10:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766468#M89166</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/386826"&gt;@jostroopers&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... if I use the shortcut ….&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you mean by "the shortcut"?&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 10:44:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766468#M89166</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-05-02T10:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766547#M89167</link>
      <description>&lt;P&gt;It's not a shortcut but i mean the aliases i changed in the .pgp file.&lt;/P&gt;
&lt;P&gt;D, *DIMLINEAR&lt;/P&gt;
&lt;P&gt;For dimlinear it's the letter D.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 11:20:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766547#M89167</guid>
      <dc:creator>jostroopers</dc:creator>
      <dc:date>2019-05-02T11:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766688#M89168</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/386826"&gt;@jostroopers&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...&amp;nbsp;i mean the aliases i changed in the .pgp file.&lt;/P&gt;
&lt;P&gt;D, *DIMLINEAR ....&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That merely calls up the command, and has no relationship to your macro.&amp;nbsp; BUT in the case of Dimensions [and similarly with Hatch patterns], in new-enough versions of AutoCAD there's a &lt;FONT color="#000000"&gt;&lt;STRONG&gt;DIMLAYER&lt;/STRONG&gt;&lt;/FONT&gt; System Variable that you can set, and all new Dimensions will go on that Layer, regardless of the current Layer at the time,&amp;nbsp;without changing&amp;nbsp;the current Layer.&amp;nbsp; Set that [and in your drawing template files], and your D alias will result in Dimensions on that Layer, and you won't need your macro at all.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 12:12:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8766688#M89168</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-05-02T12:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Macro change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8768613#M89169</link>
      <description>&lt;P&gt;I now made a panel in the ribbon with the most used commands and changed the macro.&lt;/P&gt;
&lt;P&gt;For the dim command i used DIMLAYER.&lt;/P&gt;
&lt;P&gt;It now works fine fore me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the tips.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 06:15:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/macro-change-layer/m-p/8768613#M89169</guid>
      <dc:creator>jostroopers</dc:creator>
      <dc:date>2019-05-03T06:15:38Z</dc:date>
    </item>
  </channel>
</rss>

