<?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: Lisp without user input during command in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9988713#M65697</link>
    <description>&lt;P&gt;Thanks Kent had a play unless you use "select" to pick objects it will change the previous selection not the new one that you want to use, like others I would be more inclined to use a ssget method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There really is not much difference enter command pick objects for me that is my habit of changing stuff.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jan 2021 22:25:15 GMT</pubDate>
    <dc:creator>Sea-Haven</dc:creator>
    <dc:date>2021-01-08T22:25:15Z</dc:date>
    <item>
      <title>Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9986013#M65688</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an existing lisp where currently theres shorthand commands to change previous selection to a different layer. However, there's no way to simply highlight and change it. Currently I have to highlight, use select command, then use change command to change layers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Despite all my fuddling, there seems to be no way to code lisp so it simply makes my highlight the selection then changes it. It clears my selection when Select command runs, then errors because it wants me to select before moving onto Change command. How can I make it so whatever I highlight becomes the selection, then have Change command change the layer of the selection?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current Code (Shorthand substitutes have been fully typed out instead):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Defun C:SEC9 ()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [this example is for changing to layer named "9"]&lt;BR /&gt;(COMMAND "SELECT" "")&lt;/P&gt;&lt;P&gt;(Command "CHANGE" "P" "" "P" "LA" "9" "")&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 23:31:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9986013#M65688</guid>
      <dc:creator>BriannaWong98</dc:creator>
      <dc:date>2021-01-07T23:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9986103#M65689</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(Defun C:C9 ( / ss)
  (and
    (setq ss (ssget "P"))
    (vl-cmdf "_.CHANGE" ss "" "P" "LA" "9" "")
  )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course that doesn't keep you from having to type in "C9", but once I complete my psychic interface app things will be easier on the fingers.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Which reminds me of a comic act I saw on TV...&lt;/P&gt;
&lt;P&gt;"All those who believe in telekinesis, please raise my hand."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 00:52:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9986103#M65689</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-01-08T00:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9986211#M65690</link>
      <description>&lt;P&gt;Hi John,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;That code does what mine already does. I have to highlight something, then do some sort of command or use SELECT command to make it previous, and only then does it the change command do something to it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking for a way to highlight something, then have the program successfully use the change command somehow, without me doing anything. I hope I'm making sense&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 02:02:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9986211#M65690</guid>
      <dc:creator>BriannaWong98</dc:creator>
      <dc:date>2021-01-08T02:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9986350#M65691</link>
      <description>&lt;P&gt;If you select object/s then chprop P the p implies previous/current selection set, so a simple mod of Johns code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(command "chprop" "P" "c" 1 "")&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 04:30:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9986350#M65691</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-01-08T04:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9987157#M65692</link>
      <description>&lt;P&gt;The &lt;FONT color="#000000"&gt;(ssget)&lt;/FONT&gt; function has an "&lt;STRONG&gt;&lt;FONT color="#000000"&gt;_I&lt;/FONT&gt;&lt;/STRONG&gt;" mode for &lt;FONT color="#000000"&gt;&lt;STRONG&gt;I&lt;/STRONG&gt;&lt;/FONT&gt;mplied selection, that is, pre-selected object(s):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;(defun C:SEC9 ()&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;&amp;nbsp; (command "_.chprop"&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; (cond&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ((ssget "_I"))&lt;/STRONG&gt;&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;; there's a pre-selection -- use it&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ((ssget))&lt;/STRONG&gt;&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;; otherwise, ask User for selection&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; ); cond&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; "" "_layer" "9" ""&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;&amp;nbsp; ); command&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;&amp;nbsp; (princ)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 12:46:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9987157#M65692</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-08T12:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9987183#M65693</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;SPAN&gt;the p implies previous/current selection set....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;(command "chprop" "P" "c" 1 "")&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For me [Acad2019] that does not work.&amp;nbsp; It uses the previous selection for whatever I did before, &lt;EM&gt;not &lt;/EM&gt;the current selection.&amp;nbsp; And if you invoke it &lt;EM&gt;without&lt;/EM&gt; any pre-selection, of course it does the same -- you don't get to select things.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 12:54:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9987183#M65693</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-08T12:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9987539#M65694</link>
      <description>Well, until I build the psychic interface you're going to have to do&lt;BR /&gt;SOMETHING.&lt;BR /&gt;The key here is that once you've gripped the objects they become the&lt;BR /&gt;previous selection set without having to use the SELECT command, that is if&lt;BR /&gt;PICKFIRST is set to 1 (which is stored in the registry not the drawing).</description>
      <pubDate>Fri, 08 Jan 2021 14:49:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9987539#M65694</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-01-08T14:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9987902#M65695</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;.... once you've gripped the objects they become the previous selection set ....&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I repeat, not for me [see my previous Reply].&amp;nbsp; To elaborate:&amp;nbsp; I defined a command modeled after by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;'s suggestion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:L9 () (command "_.chprop" "_previous" "" "_layer" "9" ""))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[including &lt;EM&gt;completing the selection&lt;/EM&gt;, which wasn't in theirs].&amp;nbsp; I MOVEd a couple of things to make them the Previous selection.&amp;nbsp; I then Pick-first-pre-selected some &lt;EM&gt;different&lt;/EM&gt; things, and with them selected/highlighted/gripped, called that L9 command.&amp;nbsp; Those different things were &lt;EM&gt;not&lt;/EM&gt; the ones changed to Layer 9, but rather the earlier couple of things.&amp;nbsp; &lt;STRONG&gt;Pre-selected objects do &lt;EM&gt;not&lt;/EM&gt; become the &lt;EM&gt;Previous&lt;/EM&gt; selection.&lt;/STRONG&gt;&amp;nbsp; [And yes, my PICKFIRST &amp;amp; PICKADD settings are appropriate.]&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 16:45:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9987902#M65695</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-08T16:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9987996#M65696</link>
      <description>I screwed up.  It's Implied, not Previous...&lt;BR /&gt;(setq ss (ssget "I"))</description>
      <pubDate>Fri, 08 Jan 2021 17:26:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9987996#M65696</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-01-08T17:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9988713#M65697</link>
      <description>&lt;P&gt;Thanks Kent had a play unless you use "select" to pick objects it will change the previous selection not the new one that you want to use, like others I would be more inclined to use a ssget method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There really is not much difference enter command pick objects for me that is my habit of changing stuff.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 22:25:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/9988713#M65697</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-01-08T22:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/10131615#M65698</link>
      <description>&lt;P&gt;Sorry to revive this so soon, but is there any way to macro this? The ability to push a button and have it auto select what's highlighted and change it to layer x is invaluable to me&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 23:03:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/10131615#M65698</guid>
      <dc:creator>BriannaWong98</dc:creator>
      <dc:date>2021-03-04T23:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/10131638#M65699</link>
      <description>My psychic interface will be ready in about 15 years, if I'm still around.</description>
      <pubDate>Thu, 04 Mar 2021 23:17:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/10131638#M65699</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-03-04T23:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/10131677#M65700</link>
      <description>&lt;P&gt;Nevermind, I just discovered the -LAYMCH command which is everything I need&amp;nbsp; &amp;nbsp; ^u^&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 23:31:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/10131677#M65700</guid>
      <dc:creator>BriannaWong98</dc:creator>
      <dc:date>2021-03-04T23:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp without user input during command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/10131968#M65701</link>
      <description>&lt;P&gt;Though you may not need it any more, there is a way to macro [macro-ize? macrify?] it.&amp;nbsp; If you set it up to ensure a command like SEC9 at Message 5 is loaded in every drawing, you can put into a button a macro that contains merely:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;SEC9&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 02:37:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-without-user-input-during-command/m-p/10131968#M65701</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-03-05T02:37:49Z</dc:date>
    </item>
  </channel>
</rss>

