<?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: Executing code in document context from other document in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3589374#M14420</link>
    <description>&lt;P&gt;If your requirement is to work on multiple documents, you can Application context command that can switch the active document based on which document it need to work on. Sorry, I dont see any other way to do it.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Aug 2012 14:04:54 GMT</pubDate>
    <dc:creator>Balaji_Ram</dc:creator>
    <dc:date>2012-08-21T14:04:54Z</dc:date>
    <item>
      <title>Executing code in document context from other document</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3585020#M14417</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some old code using acedCommand and was looking to see how I can use the code without modifying it. The&amp;nbsp; code needs to be executed synchronously from application context or from other document context. Is there any other option besides doing something like: Package the input data, then put it into queue and then use sendStringToExecute to execute command that reads the data from queue the data and calls the needed functions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KH&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2012 01:53:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3585020#M14417</guid>
      <dc:creator>Kari.Heinola</dc:creator>
      <dc:date>2012-08-17T01:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Executing code in document context from other document</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3587442#M14418</link>
      <description>&lt;P&gt;Hi KH,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried using the "acDocManagerPtr()-&amp;gt;executeInApplicationContext" ?&lt;/P&gt;
&lt;P&gt;This will allow you to run a piece of code in the application context.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this does not help, I suggest providing more details&amp;nbsp;about what&amp;nbsp;you are trying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2012 11:08:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3587442#M14418</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2012-08-20T11:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Executing code in document context from other document</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3588212#M14419</link>
      <description>&lt;P&gt;I need reverse of executeInApplicationContext, like executeInDocumentContext, for synchronously running various code using acadCommand.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2012 18:13:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3588212#M14419</guid>
      <dc:creator>Kari.Heinola</dc:creator>
      <dc:date>2012-08-20T18:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Executing code in document context from other document</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3589374#M14420</link>
      <description>&lt;P&gt;If your requirement is to work on multiple documents, you can Application context command that can switch the active document based on which document it need to work on. Sorry, I dont see any other way to do it.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2012 14:04:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3589374#M14420</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2012-08-21T14:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Executing code in document context from other document</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3590320#M14421</link>
      <description>&lt;P&gt;I don't understand what your trying to are saying here, except that&amp;nbsp; I don't work on multiple documents. The other document context in my email was because even if our app only works with one specified document at th time, user might work on other document and issue command that should work on my document. .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, So I have code like the pseudo code below&lt;BR /&gt;&amp;nbsp; TCHAR * func1 (args,...) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; // do something&lt;BR /&gt;&amp;nbsp; &amp;nbsp; status = acedCommand(RTSTR, _T("_.LINE"),RT3DPOINT,startPoint,RT3DPOINT,endPoint,RTSTR, _T(""), 0);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; // do something&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code works when executed in documen context, but acedCommand failes with -5001 when above code is executed in application context.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question is how I can call the code like func1 synchronously from application context?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2012 00:01:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3590320#M14421</guid>
      <dc:creator>Kari.Heinola</dc:creator>
      <dc:date>2012-08-22T00:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Executing code in document context from other document</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3594362#M14422</link>
      <description>&lt;P&gt;No, I dont see any way to make that code&amp;nbsp;work on another document.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of using acedCommand, if you implement your own Application context command, you will have more control on which document you are working with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2012 12:52:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/executing-code-in-document-context-from-other-document/m-p/3594362#M14422</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2012-08-24T12:52:02Z</dc:date>
    </item>
  </channel>
</rss>

