<?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 SendStringToExecute Synchronous in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/sendstringtoexecute-synchronous/m-p/3311265#M12129</link>
    <description>&lt;P&gt;I'm trying to convert by cide a lot of mechanical dwg by code.&lt;/P&gt;&lt;P&gt;Unfortunatly the method saveas (acDoc.Database.SaveAs) is not completly working with mechanical drawing (Mechanical 2010), so I'm trying to use&amp;nbsp;SendStringToExecute command.&lt;/P&gt;&lt;P&gt;Unfortunatly SendStringToExecuteis not synchronous, so the instruction after&amp;nbsp;SendStringToExecute (acDoc.CloseAndDiscard) is executed before the SendStringToExecute is completed.&lt;/P&gt;&lt;P&gt;How can I understand when the SendStringToExecute command is completed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2012 17:33:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-01-30T17:33:22Z</dc:date>
    <item>
      <title>SendStringToExecute Synchronous</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendstringtoexecute-synchronous/m-p/3311265#M12129</link>
      <description>&lt;P&gt;I'm trying to convert by cide a lot of mechanical dwg by code.&lt;/P&gt;&lt;P&gt;Unfortunatly the method saveas (acDoc.Database.SaveAs) is not completly working with mechanical drawing (Mechanical 2010), so I'm trying to use&amp;nbsp;SendStringToExecute command.&lt;/P&gt;&lt;P&gt;Unfortunatly SendStringToExecuteis not synchronous, so the instruction after&amp;nbsp;SendStringToExecute (acDoc.CloseAndDiscard) is executed before the SendStringToExecute is completed.&lt;/P&gt;&lt;P&gt;How can I understand when the SendStringToExecute command is completed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2012 17:33:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendstringtoexecute-synchronous/m-p/3311265#M12129</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-30T17:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: SendStringToExecute Synchronous</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendstringtoexecute-synchronous/m-p/3312777#M12130</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#666699"&gt;&amp;gt;&amp;gt; How can I understand when the SendStringToExecute command is completed?&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Split your code into two procedures&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub A&lt;/P&gt;&lt;P&gt;...run any code&lt;/P&gt;&lt;P&gt;...define EventHandler for CommandEnded or reachedQuiescentState that addresses to be handled by &lt;EM&gt;Sub B&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;...SendCommand("_SAVE" &amp;amp; vbnewline)&lt;/P&gt;&lt;P&gt;End Sub A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub B&lt;/P&gt;&lt;P&gt;...do your close or whatever has to be done after savign&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;End Sub B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck, - alfred -&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2012 18:16:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendstringtoexecute-synchronous/m-p/3312777#M12130</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-01-31T18:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: SendStringToExecute Synchronous</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendstringtoexecute-synchronous/m-p/3313507#M12131</link>
      <description>&lt;P&gt;Thanks for your answer Alfred, but I would like using&amp;nbsp; SendStringToExecute not SendCommand and what do you mean with&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;...define EventHandler for CommandEnded or reachedQuiescentState that addresses to be handled by &lt;EM&gt;Sub B &lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know CommandEnded&lt;/P&gt;&lt;P&gt;In vbNET I use &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;U&gt;AddHandler &amp;lt;object&amp;gt;, AddressOf saveDWG&lt;/U&gt; and I cannot find a object CommandEnded&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2012 09:38:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendstringtoexecute-synchronous/m-p/3313507#M12131</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-01T09:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: SendStringToExecute Synchronous</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendstringtoexecute-synchronous/m-p/3313533#M12132</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as long as you start a VB.NET-defined command you can't start any commands in it (as long as these command are not handled as transparent commands). So it's SendCommand or SendStringToExecute or any P/Invoke versions, it does not matter, the thing is "a command is running". A CIRCLE-command can't run inside a LINE-command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#666699"&gt;&amp;gt;&amp;gt; I don't know CommandEnded&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#666699"&gt;&amp;gt;&amp;gt; In vbNET I use&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim pAcadDoc As ApplicationServices.Document = ApplicationServices.Application.DocumentManager.MdiActiveDocument
AddHandler pAcadDoc.CommandEnded, AddressOf ....&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;- alfred -&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2012 10:13:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendstringtoexecute-synchronous/m-p/3313533#M12132</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-02-01T10:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: SendStringToExecute Synchronous</title>
      <link>https://forums.autodesk.com/t5/vba-forum/sendstringtoexecute-synchronous/m-p/3313555#M12133</link>
      <description>&lt;P&gt;Thanks a lot Alfred&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2012 10:32:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/sendstringtoexecute-synchronous/m-p/3313555#M12133</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-01T10:32:55Z</dc:date>
    </item>
  </channel>
</rss>

