<?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: Autocad busy in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241304#M58258</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; &lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;I get a file sharing error.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;Have you got the message more detailed? Does the message show a filename that it struggles with?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;Could that be that you get this message when opening a DWG-file more than once and forgot to .CloseInput or .Dispose the DB-object?&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;And just to understand your situation: You have 2 VS-projects, one that starts AutoCAD with "...createObject" and the other as DLL that is _NETLOADed into AutoCAD?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif" color="#666699"&gt;&amp;gt;&amp;gt; &lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;which I do by sending message to acad&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;Why that?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;If you created an AutOCAD process with CreateObject, you have the AcadApplication-object (COM) and so you have the AcadDocument-object (COM) and one step more you can use the SendCommand without using Windows-messaging (I would see SendCommand as more save).&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;- alfred -&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2011 12:33:48 GMT</pubDate>
    <dc:creator>Alfred.NESWADBA</dc:creator>
    <dc:date>2011-11-28T12:33:48Z</dc:date>
    <item>
      <title>Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3240762#M58248</link>
      <description>&lt;P&gt;I am writing a VB application that loads Autocad, opens a drawing, reads drawing and then closes it.&lt;/P&gt;&lt;P&gt;I open Autocad using CreateObject.&lt;/P&gt;&lt;P&gt;I open drawing using AcadApp.Documents.Open(FileName, &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;True&lt;/FONT&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;I then wait for the AcadApp.EndOpen event﻿ to fire&lt;/P&gt;&lt;P&gt;I then read drawing&lt;/P&gt;&lt;P&gt;I then try to close drawing using AcadApp.ActiveDocument.Close(&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;False&lt;/FONT&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;but it fails with Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Help!﻿&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Nov 2011 13:10:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3240762#M58248</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-27T13:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3240784#M58249</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;imho you don't need to wait for EndOpen-event (as long you are not working with multithreading).&lt;/P&gt;&lt;P&gt;The code after the line "&lt;EM&gt;&lt;FONT color="#666699"&gt;...Documents.Open...&lt;/FONT&gt;&lt;/EM&gt;" will continue with the next code-line after the drawing is loaded into editor (and not before). So I see no necessarity for handling that with an event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the event may be the source of your problem, because when you try to start the "...ActiveDocument.Close...." while you are in the event-handler, don't forget that this event-handler is (indirectly) part of your document-object ==&amp;gt; you can't close the doc while you are "in the document" - or with other words - the document is locked because a document-based-event is active.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to rewrite the code without this event-handler and that may be the solution. If not ... let use see a minimum code snippet that makes it for us possible to reproduce the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck, - alfred -&lt;/P&gt;</description>
      <pubDate>Sun, 27 Nov 2011 13:51:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3240784#M58249</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2011-11-27T13:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3240896#M58250</link>
      <description>&lt;P&gt;Take a look&amp;nbsp;&lt;A target="_self" href="http://through-the-interface.typepad.com/through_the_interface/2010/02/handling-com-calls-rejected-by-autocad-from-an-external-net-application.html"&gt;here&lt;/A&gt;, it may solve your error.&lt;/P&gt;</description>
      <pubDate>Sun, 27 Nov 2011 20:43:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3240896#M58250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-27T20:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241164#M58251</link>
      <description>&lt;P&gt;Thanks to you both, and so I decided to write the code as&amp;nbsp;an inprocess class.&lt;/P&gt;&lt;P&gt;The code is this:&lt;/P&gt;&lt;PRE&gt;   Friend WithEvents AcadDoc As Document
   Friend WithEvents DocCol As DocumentCollection
   &amp;lt;CommandMethod("OMREADTITLES")&amp;gt; Public Sub OMREADTITLES()
      fls = Directory.GetFiles(cFolder)
      For Each n As String In fls
         If n.ToUpper.EndsWith("DWG") Then
            AcadDoc = DocCol.Open(n)
            GetTitleSheets()
         End If
      Next
      For Each doc As Document In Application.DocumentManager
         doc.CloseAndDiscard()
      Next
   End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;GetTitleSheets is a routine that reads title blocks and extracts their attributes. All works well.&lt;/P&gt;&lt;P&gt;BUT&lt;/P&gt;&lt;P&gt;CloseAndDiscard returns error - Drawing Busy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand why. Each drawing is opened as Read Only. I don't alter the database (at least I don't think so)&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 10:20:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241164#M58251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-28T10:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241200#M58252</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you don't use the events remove the "WithEvents" phrase in the declaration.&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; BUT [...] CloseAndDiscard returns error - Drawing Busy&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;That is not a save way: to close all documents, also that one that has an open command ... your command!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However you can try to change the calling-attributes in that way:&lt;/P&gt;&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;&amp;lt;CommandMethod("OMREADTITLES", &lt;FONT color="#666699"&gt;&lt;EM&gt;&lt;STRONG&gt;Autodesk.AutoCAD.Runtime.CommandFlags.Session&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;)&amp;gt; _&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just as an additional input: I would open one drawing, do the modifications needed and close it then. Don't open all documents parallel. It's not only a question of memory and performance, it's also a questions of how save will your documents be if the file 150 crashes AutoCAD because of any defect ==&amp;gt; so all your previously opened files are unsave in this case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And one more input: why opening the drawings in the editor? Do you do some Zoom-modifications .... or any functions that need the editor? Because opening just the database will be much more efficient than loading the drawings into the editor.&lt;/P&gt;&lt;P&gt;For that look to "&lt;EM&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;New Autodesk.AutoCAD.DatabaseServices.Database(....)&lt;/FONT&gt;&lt;/EM&gt;" and "&lt;EM&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;...Database.ReadDwgFile(...&lt;/FONT&gt;&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 10:54:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241200#M58252</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2011-11-28T10:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241216#M58253</link>
      <description>&lt;P&gt;Thanks for this - food for thought! Never thought about just using the database.&lt;/P&gt;&lt;P&gt;The withevents is used as a also trap events.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did originally try to close the dwg in the main loop - same error.&lt;/P&gt;&lt;P&gt;But logically, my command will be active so how to close.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I tried this:-&lt;/P&gt;&lt;PRE&gt;   &amp;lt;CommandMethod("OMREADTITLES", Autodesk.AutoCAD.Runtime.CommandFlags.Session)&amp;gt; Public Sub OMREADTITLES()
      fls = Directory.GetFiles(cFolder)
      For Each n As String In fls
         If n.ToUpper.EndsWith("DWG") Then
            AcadDoc = DocCol.Open(n)
            GetTitleSheets()
            AcadDoc.CloseAndDiscard()
         End If
      Next
   End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Still get the Drawing Busy&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 11:01:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241216#M58253</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-28T11:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241226#M58254</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This statement defines your current doc:&lt;/P&gt;&lt;PRE&gt;AcadDoc = DocCol.Open(n)&lt;/PRE&gt;&lt;P&gt;Save your current drawing e.g. "Drawing1" previously in a varaible and before closing the "AcadDoc" make your "Drawing1" active.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Plus ,,, have you tried changing the CommandMethod-Attributes?&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; The withevents is used as a also trap events.&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;As long as your routine "&lt;FONT face="lucida sans unicode,lucida sans"&gt;&lt;EM&gt;GetTitleSheets&lt;/EM&gt;&lt;/FONT&gt;" does all modifications you can disable the eventhandling .... just for test! Do you get the exceptions then also or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 11:14:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241226#M58254</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2011-11-28T11:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241258#M58255</link>
      <description>&lt;P&gt;Thanks very much - solved!&lt;/P&gt;&lt;PRE&gt;      For Each n As String In fls
         If n.ToUpper.EndsWith("DWG") Then
            Dim db As New Database(False, True)
            db.ReadDwgFile(n, FileOpenMode.OpenForReadAndAllShare, False, "")
            GetTitleSheets(db)
         End If
      Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;No need to close drawings etc. I have got this right?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 11:46:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241258#M58255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-28T11:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241268#M58256</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;well there are some parts to be done after opening a database:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#666699" face="lucida sans unicode,lucida sans"&gt;db.CloseInput(True)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#666699" face="lucida sans unicode,lucida sans"&gt;db.Dispose()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;plus don't forget to save &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day, - alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 12:04:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241268#M58256</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2011-11-28T12:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241284#M58257</link>
      <description>&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;OK and thanks again.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;Actually I don't save, but I do write data to an external file.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;BUT - now I have a new question.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;OK. The code works great inside AutoCAD. I also can attach VS to the Acad process and check every line. All seems fine.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;However I actually have an app that loads Autocad using CreateObject etc. I will not be showing it when debugged.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;Now I really want to execute the code from my app which I do by sending message to acad.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;App.ActiveDocument.SendCommand(&lt;/FONT&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;cnEsc &amp;amp; cnEsc &amp;amp; &lt;/FONT&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif" color="#a31515"&gt;&lt;FONT color="#a31515"&gt;"OMREADTITLES "&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;AutoCad receives message and executes BUT I get a file sharing error.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;If I stop VS, and execute the command inside Acad, it does work properly.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;Any ideas?﻿&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;﻿&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 12:22:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241284#M58257</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-28T12:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241304#M58258</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; &lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;I get a file sharing error.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;Have you got the message more detailed? Does the message show a filename that it struggles with?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;Could that be that you get this message when opening a DWG-file more than once and forgot to .CloseInput or .Dispose the DB-object?&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;And just to understand your situation: You have 2 VS-projects, one that starts AutoCAD with "...createObject" and the other as DLL that is _NETLOADed into AutoCAD?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif" color="#666699"&gt;&amp;gt;&amp;gt; &lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;which I do by sending message to acad&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;Why that?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;If you created an AutOCAD process with CreateObject, you have the AcadApplication-object (COM) and so you have the AcadDocument-object (COM) and one step more you can use the SendCommand without using Windows-messaging (I would see SendCommand as more save).&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;- alfred -&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 12:33:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3241304#M58258</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2011-11-28T12:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3242432#M58259</link>
      <description>&lt;P&gt;I have a number of projects in the VS solution.&lt;/P&gt;&lt;P&gt;One is a Library of various functions, classes etc. which is used by other projects.&lt;/P&gt;&lt;P&gt;One is a library of my own controls&lt;/P&gt;&lt;P&gt;One is the exe file&lt;/P&gt;&lt;P&gt;One is a&amp;nbsp;class which wraps around loading AutoCad's different versions. It&amp;nbsp;uses&amp;nbsp;Com to load a hidden version of AutoCad. It also provides a way&amp;nbsp;for the exe file to know of changes inside AutoCad.&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;One is an independant class&amp;nbsp;that loads as an inprocess class. It provides various functions such as reading title sheets, as well as block and layer manipulation. It effectively adds my Commands to AutoCad.&lt;/P&gt;&lt;P&gt;Following your advice, the function that reads title sheets does this using the database and not the editor. It now (thankyou)&amp;nbsp;works faultlessly when called inside AutoCad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I invoke it from my exe. I get this error:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Autodesk.AutoCAD.Runtime.Exception: eFileSharingViolation &amp;nbsp;&amp;nbsp; at Autodesk.AutoCAD.DatabaseServices.Database.ReadDwgFile(String fileName, FileOpenMode mode, Boolean allowCPConversion, String password) &amp;nbsp;&amp;nbsp; at om2011net.clsAcad.OMREADTITLES() in D:\Visual Studio 2008\Projects\Acadnet2011\clsAcad.vb:line 374 &amp;nbsp;&amp;nbsp; at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction) &amp;nbsp;&amp;nbsp; at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction) &amp;nbsp;&amp;nbsp; at Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction) &amp;nbsp;&amp;nbsp; at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Furthermore, nothing was written to an external file, so it hasn't even got into the routine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 23:36:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3242432#M58259</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-28T23:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad busy</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3242684#M58260</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this part of the exception-message:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#666699" face="lucida sans unicode,lucida sans"&gt;eFileSharingViolation &amp;nbsp;&amp;nbsp; at Autodesk.AutoCAD.DatabaseServices.Database.ReadDwg&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;gives you a lot of info and I would guess that you open a file that is already open (or at least that was opened but not closed afterwards). I think that you should verify the workflow in your app .... where and when does your app open a database (of have already anyone open), could it be that the list of files you work through contains double filesnames ... or whatever ==&amp;gt; for analyzing that you must have your code, I can't do that for you, sorry!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck, - alfred -&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2011 08:44:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-busy/m-p/3242684#M58260</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2011-11-29T08:44:06Z</dc:date>
    </item>
  </channel>
</rss>

