<?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: Run macros from commandline in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11752007#M42562</link>
    <description>&lt;P&gt;As I said (and Pendean confirmed it), it is not an option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3457218"&gt;@sterling.parker&lt;/a&gt;&amp;nbsp; schrieb:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;"but at the moment that's outside the scope of my question."&lt;/P&gt;
&lt;P&gt;The question ended with my answer, sorry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;"I am aware of LISP and if that's my only option to add new commands then I suppose I may have to learn"&lt;/P&gt;
&lt;P&gt;You don't need to learn the great world of API programming, you can easily use your menu macro knowledge&lt;/P&gt;
&lt;P&gt;and &lt;FONT color="#FF0000"&gt;write it in a bit different manner&lt;/FONT&gt; with &lt;FONT color="#008000"&gt;prefix part&lt;/FONT&gt; in front and another &lt;FONT color="#0000FF"&gt;suffic part&lt;/FONT&gt; at the end.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your sample:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;^C^C_.circle \5&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;(defun C:NEWCOMMANDNAME nil&lt;/FONT&gt; &lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;(command-s "CIRCLE" Pause "5")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With just 3 lispfunctions you can do what you want and with 3-4 function more you can do much more than without lisp setq&amp;amp;ssget are the next you will learn and never want to miss again.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Feb 2023 21:28:43 GMT</pubDate>
    <dc:creator>cadffm</dc:creator>
    <dc:date>2023-02-13T21:28:43Z</dc:date>
    <item>
      <title>Run macros from commandline</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11751476#M42557</link>
      <description>&lt;P&gt;It's entirely possible I'm missing something here, but I've googled several variations on this problem and can't seem to figure out what.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From what I can tell there are two ways of creating simple "custom commands" in AutoCAD: Action Recorder, and Command Macros.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With Action Recorder, when I create a new Action Macro, whatever the name is can be run from the command line. So for example, I can type &lt;STRONG&gt;DRB&lt;/STRONG&gt; and it runs my "draw order, back" action macro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sterlingparker_0-1676310274656.png" style="width: 397px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1175871iCBA68A0D24ACEA5D/image-dimensions/397x363?v=v2" width="397" height="363" role="button" title="sterlingparker_0-1676310274656.png" alt="sterlingparker_0-1676310274656.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With Command Macros, such as this one from Insights ("Select and Erase Similar Objects"), it can be assigned to a &lt;EM&gt;button&lt;/EM&gt; in the interface, or a keyboard shortcut, &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;but I cannot seem to find a way to run it by name from the command line by typing a short command or name.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&amp;nbsp;Giving it a "command display name" such as "SSE" doesn't work, even though it seems like that would be the place to do it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sterlingparker_1-1676310431433.png" style="width: 718px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1175873iEB7472CC44779C28/image-dimensions/718x219?v=v2" width="718" height="219" role="button" title="sterlingparker_1-1676310431433.png" alt="sterlingparker_1-1676310431433.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, for most of my purposes, Action Recorder is... fine. It's just fine. But command macros seem much more powerful and I'd like to start learning to use them. However the fact I can't seem to type them by name (in the same fashion as PLINE or QS) is really hanging up my workflow. I hate clicking buttons.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to create a command macro such as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;^C^C_.circle \5&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;and&lt;/EM&gt; assign some kind of shortname to run it from the command line by typing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 17:53:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11751476#M42557</guid>
      <dc:creator>sterling.parker</dc:creator>
      <dc:date>2023-02-13T17:53:31Z</dc:date>
    </item>
    <item>
      <title>Betreff: Run macros from commandline</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11751583#M42558</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can define new commands by actionmacro recorder, but never by a button&amp;nbsp; menu or toolpalette-tool.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;Command Macros" aka Menu macros&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In your case (not LT user), you can use some simple Lisp functions!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:NEWCOMMANDNAME nil (command-s "CIRCLE" Pause "5"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Copy and paste it into commandline as a first try.&lt;/P&gt;
&lt;P&gt;In this drawing, in this file session, the new command&amp;nbsp;NEWCOMMANDNAME works.&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>Mon, 13 Feb 2023 21:24:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11751583#M42558</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2023-02-13T21:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Run macros from commandline</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11751826#M42559</link>
      <description>&lt;P&gt;Change the Command Name to SSE if that's what you want to use to start the command.&lt;/P&gt;&lt;P&gt;After placing it in the Ribbon you can add what you have as the&amp;nbsp;Command Name now as the Display Name.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 19:52:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11751826#M42559</guid>
      <dc:creator>TomBeauford</dc:creator>
      <dc:date>2023-02-13T19:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Run macros from commandline</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11751890#M42560</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/540307"&gt;@TomBeauford&lt;/a&gt;&amp;nbsp;Unfortunately this doesn't seem to work. I tried adding the macro to the ribbon as shown, but even after restarting AutoCAD it doesn't invoke by typing the name. Clicking the button runs the macro as expected, but the commands shown in the console output are just the commands that make up the macro, it doesn't invoke the macro by name.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sterlingparker_0-1676318707049.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1175979iF8AD1530092C839D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sterlingparker_0-1676318707049.png" alt="sterlingparker_0-1676318707049.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp;I am aware of LISP and if that's my only option to add new commands then I suppose I may have to learn, but at the moment that's outside the scope of my question. I'm really hoping that there's some native way to use macros as commands, besides Action Recorder (which is sometimes very trial-and-error process and not very flexible)&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 20:06:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11751890#M42560</guid>
      <dc:creator>sterling.parker</dc:creator>
      <dc:date>2023-02-13T20:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Run macros from commandline</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11751967#M42561</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3457218"&gt;@sterling.parker&lt;/a&gt; You cannot easily call a button macro or action-recoding by just typing a couple of letters: it's just not a thing in AutoCAD. It's the wrong coding tool for that type of access. Those CUI category entries are not there to create such access either, they are just informational for the various pop-ups, so that can be confusing for users too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pendean_0-1676321573480.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1175990i71868D7903063BD5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pendean_0-1676321573480.png" alt="pendean_0-1676321573480.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LISP is not that hard to master for your needs if I just look at your posted macros: if you change your mind there are lots of good start tutorials to get you beyond your hesitation-point.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 20:55:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11751967#M42561</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2023-02-13T20:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Run macros from commandline</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11752007#M42562</link>
      <description>&lt;P&gt;As I said (and Pendean confirmed it), it is not an option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3457218"&gt;@sterling.parker&lt;/a&gt;&amp;nbsp; schrieb:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;"but at the moment that's outside the scope of my question."&lt;/P&gt;
&lt;P&gt;The question ended with my answer, sorry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;"I am aware of LISP and if that's my only option to add new commands then I suppose I may have to learn"&lt;/P&gt;
&lt;P&gt;You don't need to learn the great world of API programming, you can easily use your menu macro knowledge&lt;/P&gt;
&lt;P&gt;and &lt;FONT color="#FF0000"&gt;write it in a bit different manner&lt;/FONT&gt; with &lt;FONT color="#008000"&gt;prefix part&lt;/FONT&gt; in front and another &lt;FONT color="#0000FF"&gt;suffic part&lt;/FONT&gt; at the end.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your sample:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;^C^C_.circle \5&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;(defun C:NEWCOMMANDNAME nil&lt;/FONT&gt; &lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;(command-s "CIRCLE" Pause "5")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With just 3 lispfunctions you can do what you want and with 3-4 function more you can do much more than without lisp setq&amp;amp;ssget are the next you will learn and never want to miss again.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 21:28:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/run-macros-from-commandline/m-p/11752007#M42562</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2023-02-13T21:28:43Z</dc:date>
    </item>
  </channel>
</rss>

