<?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 (during a command) stops after user input? in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9149490#M123073</link>
    <description>&lt;P&gt;Perhaps like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:FromPer (/ *error* osm ort pnt)

  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (if osm (setvar 'osmode osm))
    (if ort (setvar 'orthomode ort))
    (princ))

  ; ------------
  (setq osm (getvar 'osmode)
	ort (getvar 'orthomode))
  
  (setvar 'osmode 128)
  (setq pnt (getpoint "\nSpecify base point: " (getvar 'lastpoint)))
  (setvar 'orthomode 1)
  (command "_from" "_non" pnt pause)
  (*error* "end")
  )&lt;/PRE&gt;</description>
    <pubDate>Fri, 15 Nov 2019 17:17:36 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2019-11-15T17:17:36Z</dc:date>
    <item>
      <title>Macro (during a command) stops after user input?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9123566#M123065</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;I created the following macro as a toolbar button and initialize it during any command, 'stretch' in my case.&lt;/P&gt;&lt;PRE&gt;_from;_per;\ ^O _non&lt;/PRE&gt;&lt;P&gt;My goal is to relocate a door at a certain distance from a grid line.&lt;/P&gt;&lt;P&gt;Everything goes fine but after i select the _from base point as user input, the rest of the macro doesn't run. I couldn't figure it out why.&amp;nbsp; Any idea to solve the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update: I figured out that the rest of the macro after the user input&amp;nbsp;c&lt;SPAN&gt;haracter executes after the command ends. But i want it to execute after i click the temporary _from base point.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&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, 02 Nov 2019 15:03:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9123566#M123065</guid>
      <dc:creator>yuceldemir1</dc:creator>
      <dc:date>2019-11-02T15:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (during a command) stops after user input?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9123676#M123066</link>
      <description>&lt;P&gt;Would you visually ilustrate the workflow and the issue by recording a video capture? Thanks.&lt;/P&gt;
&lt;P&gt;You could use Autodesk's&amp;nbsp;&amp;nbsp;&lt;A href="https://knowledge.autodesk.com/search-result/caas/simplecontent/content/download-autodesk-screencast.html" target="_blank" rel="noopener"&gt;SCREENCAST&lt;/A&gt;&amp;nbsp;, it's free.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2019 18:07:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9123676#M123066</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-11-02T18:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (during a command) stops after user input?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9123683#M123067</link>
      <description>Did you really intend what you typed in the macro?&lt;BR /&gt;&lt;BR /&gt;Your macro does:&lt;BR /&gt;&lt;BR /&gt;start FROM&lt;BR /&gt;set PERP &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;odd choice for an object selection?&lt;BR /&gt;pause for a user selection &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;presumably when you click on the object?&lt;BR /&gt;turn off ortho&lt;BR /&gt;turn off running osnaps&lt;BR /&gt;&lt;BR /&gt;then presumably it continues on.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 02 Nov 2019 18:11:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9123683#M123067</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2019-11-02T18:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (during a command) stops after user input?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9124611#M123068</link>
      <description>&lt;P&gt;I initialize the macro after entering a command (move, stretch etc.) as you see in the screencast via a toolbar button. By the way please ignore my user interface and button icons &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt; they are totally different from default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;_from;_per;\ ^O _non&lt;/PRE&gt;&lt;P&gt;I want my macro to be conitinued after i click the green horizontal line (toggle ortho and disable snaps). But in my case it executes after i relocate the door.&amp;nbsp;I hope I expressed my problem this time. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="iframe-container"&gt;&lt;IFRAME width="640" height="590" src="https://screencast.autodesk.com/Embed/Timeline/9128f4ab-1cd9-4829-961d-d9051a308b93" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Nov 2019 22:04:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9124611#M123068</guid>
      <dc:creator>yuceldemir1</dc:creator>
      <dc:date>2019-11-03T22:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (during a command) stops after user input?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9125204#M123069</link>
      <description>&lt;P&gt;I see your point but don't know how to fix your macro.&lt;/P&gt;
&lt;P&gt;I can imagine that I would solve it using LISP. Are you on LT?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 10:10:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9125204#M123069</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-11-04T10:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (during a command) stops after user input?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9125887#M123070</link>
      <description>&lt;P&gt;No, i use version 2015. Any LISP solution will also be appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 15:44:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9125887#M123070</guid>
      <dc:creator>yuceldemir1</dc:creator>
      <dc:date>2019-11-04T15:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (during a command) stops after user input?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9126041#M123071</link>
      <description>&lt;P&gt;The first one just mimics your macro. You need to set a tool's macro to 'FromPer. Note the apostrophe.&lt;/P&gt;
&lt;P&gt;What would bother me is that it won't allow you a quick repetition by RT click. That is what the second routine is good for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:FromPer (/ *error* osm ort)

  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (if osm (setvar 'osmode osm))
    (if ort (setvar 'orthomode ort))
    (princ))

  ; ------------
  (setq osm (getvar 'osmode)
	ort (getvar 'orthomode))
  
  (setvar 'orthomode 1)
  (setvar 'osmode 0)
  (command "_from" "_per" pause)
  (*error* "end")
  )



(defun c:StretchFromPer (/ *error* osm ort)

  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (if osm (setvar 'osmode osm))
    (if ort (setvar 'orthomode ort))
    (princ))

  ; ------------
  (setq osm (getvar 'osmode)
	ort (getvar 'orthomode))
  (command-s "_.select")
  (command "_.stretch" "_p" "" pause)
  (setvar 'orthomode 1)
  (setvar 'osmode 0)
  (command "_from" "_per" pause)
  (*error* "end")
  )&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Nov 2019 16:57:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9126041#M123071</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-11-04T16:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (during a command) stops after user input?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9126249#M123072</link>
      <description>&lt;P&gt;Ok, your first suggestion works well except one thing. I dont want to turn on ortho mode before clicking the guide line which i showed in the screencast. Your routine sets the system variable&amp;nbsp; 1 before clicking the guide line. Other than that, it works like a charm. I don't care &lt;SPAN&gt;repetition by RT click&lt;/SPAN&gt;.&lt;BR /&gt;I didn't now an apostrophes meaning in a macro. I assume it interprets a lisp into a macro, right? Anyway, my last question is what i mentioned at the beginning. Can we turn ortho on after clicking the guide line? Since we still couldn't edit the gap between the from point selection and the end of the command. I suppose it's not possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your effort, i will accept your solution after your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 18:20:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9126249#M123072</guid>
      <dc:creator>yuceldemir1</dc:creator>
      <dc:date>2019-11-04T18:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (during a command) stops after user input?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9149490#M123073</link>
      <description>&lt;P&gt;Perhaps like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:FromPer (/ *error* osm ort pnt)

  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (if osm (setvar 'osmode osm))
    (if ort (setvar 'orthomode ort))
    (princ))

  ; ------------
  (setq osm (getvar 'osmode)
	ort (getvar 'orthomode))
  
  (setvar 'osmode 128)
  (setq pnt (getpoint "\nSpecify base point: " (getvar 'lastpoint)))
  (setvar 'orthomode 1)
  (command "_from" "_non" pnt pause)
  (*error* "end")
  )&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Nov 2019 17:17:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9149490#M123073</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-11-15T17:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (during a command) stops after user input?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9150761#M123074</link>
      <description>&lt;P&gt;Perfect! Thank you for dealing with my very personal problem.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2019 17:45:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/macro-during-a-command-stops-after-user-input/m-p/9150761#M123074</guid>
      <dc:creator>yuceldemir1</dc:creator>
      <dc:date>2019-11-16T17:45:23Z</dc:date>
    </item>
  </channel>
</rss>

