<?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: Document &amp;quot;xxx.dwg&amp;quot; has a command in progress. in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869399#M79241</link>
    <description>You have answered twice to my question.&lt;BR /&gt;
 The first answer:&lt;BR /&gt;
&lt;BR /&gt;
"Yes I lock the document (variable named ThisDrawing) with ThisDrawing.LockDocument()&lt;BR /&gt;
&lt;BR /&gt;
Then at the end of the function I use this:&lt;BR /&gt;
ThisDrawing.LockDocument(DocumentLockMode.NotLocked, string.Empty, string.Empty, false);"&lt;BR /&gt;
&lt;BR /&gt;
describes a wrong method.&lt;BR /&gt;
&lt;BR /&gt;
The second answer:&lt;BR /&gt;
&lt;BR /&gt;
" 	 Re: Document "xxx.dwg" has a command in progress.&lt;BR /&gt;
Document ThisDrawing = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocum ent;&lt;BR /&gt;
DocumentLock dLock = ThisDrawing.LockDocument();&lt;BR /&gt;
// modify the database here&lt;BR /&gt;
dLock.Dispose();"&lt;BR /&gt;
&lt;BR /&gt;
is correct.&lt;BR /&gt;
&lt;BR /&gt;
In general, you should lock the document any way you want, but to unlock it, you just dispose the object you got when you locked the doc. I don't know what "NotLocked" is for, but it sure does not unlock the document.&lt;BR /&gt;
This locks the doc (as you already know):&lt;BR /&gt;
DocumentLock dLock = ThisDrawing.LockDocument(DocumentLockMode....., ...., ...., ....);&lt;BR /&gt;
then you do your work...&lt;BR /&gt;
...&lt;BR /&gt;
and lastly you unlock the doc to allow for other commands to manipulate it:&lt;BR /&gt;
dLock.Dispose();</description>
    <pubDate>Tue, 23 Jan 2007 23:44:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-01-23T23:44:46Z</dc:date>
    <item>
      <title>Document "xxx.dwg" has a command in progress.</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869393#M79235</link>
      <description>I have a .NET app that shows a modeless dialog which is a customized print application.&lt;BR /&gt;
It works fine except when I try to use the "qsave" command on the drawing after plotting or previewing it.&lt;BR /&gt;
I get a message at the command line:&lt;BR /&gt;
Document "xxx.dwg" has a command in progress. &lt;BR /&gt;
&lt;BR /&gt;
Other commands such as Line, Copy, Move etc. work fine. Even the "Save" command works.&lt;BR /&gt;
&lt;BR /&gt;
I've searched and read every post I could find on this subject including some in Russian (which may have lost something in the translation to English).&lt;BR /&gt;
&lt;BR /&gt;
Is there some way to tell the Document that it doesn't have a command in progress?</description>
      <pubDate>Mon, 22 Jan 2007 23:04:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869393#M79235</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-22T23:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Document "xxx.dwg" has a command in progress.</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869394#M79236</link>
      <description>Does your app lock the document during its execution? If so, how does it unlock it?</description>
      <pubDate>Tue, 23 Jan 2007 07:55:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869394#M79236</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-23T07:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Document "xxx.dwg" has a command in progress.</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869395#M79237</link>
      <description>Yes I lock the document (variable named ThisDrawing) with ThisDrawing.LockDocument()&lt;BR /&gt;
&lt;BR /&gt;
Then at the end of the function I use this:&lt;BR /&gt;
ThisDrawing.LockDocument(DocumentLockMode.NotLocked, string.Empty, string.Empty, false);</description>
      <pubDate>Tue, 23 Jan 2007 15:17:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869395#M79237</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-23T15:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Document "xxx.dwg" has a command in progress.</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869396#M79238</link>
      <description>Document ThisDrawing = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
DocumentLock dLock = ThisDrawing.LockDocument();&lt;BR /&gt;
// modify the database here&lt;BR /&gt;
dLock.Dispose();</description>
      <pubDate>Tue, 23 Jan 2007 16:31:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869396#M79238</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-23T16:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Document "xxx.dwg" has a command in progress.</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869397#M79239</link>
      <description>Which of the two do you use? The first one is wrong. The second should work and allow you to execute commands after its completion.</description>
      <pubDate>Tue, 23 Jan 2007 20:16:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869397#M79239</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-23T20:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Document "xxx.dwg" has a command in progress.</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869398#M79240</link>
      <description>What -two- do you mean?&lt;BR /&gt;
The first part is to create the lock and the last is to dispose of the lock.</description>
      <pubDate>Tue, 23 Jan 2007 22:41:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869398#M79240</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-23T22:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Document "xxx.dwg" has a command in progress.</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869399#M79241</link>
      <description>You have answered twice to my question.&lt;BR /&gt;
 The first answer:&lt;BR /&gt;
&lt;BR /&gt;
"Yes I lock the document (variable named ThisDrawing) with ThisDrawing.LockDocument()&lt;BR /&gt;
&lt;BR /&gt;
Then at the end of the function I use this:&lt;BR /&gt;
ThisDrawing.LockDocument(DocumentLockMode.NotLocked, string.Empty, string.Empty, false);"&lt;BR /&gt;
&lt;BR /&gt;
describes a wrong method.&lt;BR /&gt;
&lt;BR /&gt;
The second answer:&lt;BR /&gt;
&lt;BR /&gt;
" 	 Re: Document "xxx.dwg" has a command in progress.&lt;BR /&gt;
Document ThisDrawing = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocum ent;&lt;BR /&gt;
DocumentLock dLock = ThisDrawing.LockDocument();&lt;BR /&gt;
// modify the database here&lt;BR /&gt;
dLock.Dispose();"&lt;BR /&gt;
&lt;BR /&gt;
is correct.&lt;BR /&gt;
&lt;BR /&gt;
In general, you should lock the document any way you want, but to unlock it, you just dispose the object you got when you locked the doc. I don't know what "NotLocked" is for, but it sure does not unlock the document.&lt;BR /&gt;
This locks the doc (as you already know):&lt;BR /&gt;
DocumentLock dLock = ThisDrawing.LockDocument(DocumentLockMode....., ...., ...., ....);&lt;BR /&gt;
then you do your work...&lt;BR /&gt;
...&lt;BR /&gt;
and lastly you unlock the doc to allow for other commands to manipulate it:&lt;BR /&gt;
dLock.Dispose();</description>
      <pubDate>Tue, 23 Jan 2007 23:44:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869399#M79241</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-23T23:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Document "xxx.dwg" has a command in progress.</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869400#M79242</link>
      <description>Ah, I understand what you were asking now.&lt;BR /&gt;
Yes, I was mistaken in thinking that .LockDocument(anything here) could UNLock a document.</description>
      <pubDate>Wed, 24 Jan 2007 01:23:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-quot-xxx-dwg-quot-has-a-command-in-progress/m-p/1869400#M79242</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-24T01:23:03Z</dc:date>
    </item>
  </channel>
</rss>

