<?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: Working with Session Flag in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2930174#M61753</link>
    <description>&lt;P&gt;I fixed all of the lock errors and have the Session flag in the CommandMethod, but I'm getting the invalid exectution context error again. &amp;nbsp;It happens when the code tries to open the newly created document.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Feb 2011 14:33:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-02-25T14:33:16Z</dc:date>
    <item>
      <title>Working with Session Flag</title>
      <link>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2928982#M61750</link>
      <description>&lt;P&gt;I am creating an AutoCAD plugin that gathers information from the current drawing and the user, inserts a block, selects an area of the drawing, creates a new drawing and copies the selected items to the new drawing. &amp;nbsp;The problem is that I need to use a function similar to zoomextents on the new drawing, which seems to conflict with the other operations I need to perform.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a proposed solution that suggested adding a Session flag to the CommandMethod, but that caused another error, earlier in execution when the drawing-specific functionality . &amp;nbsp;Is there any way to get all of this functionality to work with one CommandMethod? &amp;nbsp;The errors messages I received are:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="white-space: pre;"&gt;&lt;/SPAN&gt;w/out session flag: "Invalid execution context"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="white-space: pre;"&gt;&lt;/SPAN&gt;w/ session flag "eLockViolation"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your answers.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2011 18:16:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2928982#M61750</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-24T18:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Session Flag</title>
      <link>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2929096#M61751</link>
      <description>&lt;P&gt;In reguards to the eLockViolation&lt;/P&gt;&lt;P&gt;You need to lock the drawing first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A rel="nofollow" href="http://forums.autodesk.com/t5/NET/im-getting-eLockViolation/m-p/2690906#M19370" target="_blank"&gt;http://forums.autodesk.com/t5/NET/im-getting-eLockViolation/m-p/2690906#M19370&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2011 19:36:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2929096#M61751</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2011-02-24T19:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Session Flag</title>
      <link>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2929136#M61752</link>
      <description>&lt;P&gt;Use both the Session flag (to fix the Invalid Execution Context) and a Document Lock (to fix the eLockViolation).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you apply the Session flag to a command, you are then responsible for making sure the appropriate documents are locked.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2011 20:01:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2929136#M61752</guid>
      <dc:creator>chiefbraincloud</dc:creator>
      <dc:date>2011-02-24T20:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Session Flag</title>
      <link>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2930174#M61753</link>
      <description>&lt;P&gt;I fixed all of the lock errors and have the Session flag in the CommandMethod, but I'm getting the invalid exectution context error again. &amp;nbsp;It happens when the code tries to open the newly created document.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2011 14:33:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2930174#M61753</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-25T14:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Session Flag</title>
      <link>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2932358#M61754</link>
      <description>&lt;P&gt;I'm still stuck on this. &amp;nbsp;Does anyone have any other ideas? &amp;nbsp;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2011 14:46:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2932358#M61754</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-28T14:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Session Flag</title>
      <link>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2932612#M61755</link>
      <description>&lt;P&gt;Can you post a complete code example with an example of the error?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2011 16:59:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2932612#M61755</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2011-02-28T16:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Session Flag</title>
      <link>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2933080#M61756</link>
      <description>&lt;P&gt;Unfortunately I am not able to include all of the code, but the code that is not functioning properly is in forum code.txt in the secondfunction (createDriveFile). &amp;nbsp;The line where the code fails is marked with a comment. &amp;nbsp;It is the line where the file should be opened.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2011 20:43:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2933080#M61756</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-28T20:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Session Flag</title>
      <link>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2933206#M61757</link>
      <description>&lt;P&gt;This line does not look correct (Dim newDWG = Application.DocumentManager.Open(filePath, False)).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My guess is you intended newdwg to be an ApplicationServices.Document.&amp;nbsp; Try this:&lt;/P&gt;&lt;P&gt;Dim newDWG as ApplicationServices.Document = Application.DocumentManager.Open(filePath, False).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#0000ff"&gt;&lt;FONT size="2" color="#0000ff"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2011 21:27:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2933206#M61757</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2011-02-28T21:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Session Flag</title>
      <link>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2934016#M61758</link>
      <description>&lt;P&gt;I tried the more specific declaration, but the problem seems to be with the open command being called here, although it is called from session mode. &amp;nbsp;I got the exact same error with this change.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 14:24:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/working-with-session-flag/m-p/2934016#M61758</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-01T14:24:59Z</dc:date>
    </item>
  </channel>
</rss>

