>> I get a file sharing error.
Have you got the message more detailed? Does the message show a filename that it struggles with?
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?
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?
>> which I do by sending message to acad
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).
- alfred -
I have a number of projects in the VS solution.
One is a Library of various functions, classes etc. which is used by other projects.
One is a library of my own controls
One is the exe file
One is a class which wraps around loading AutoCad's different versions. It uses Com to load a hidden version of AutoCad. It also provides a way for the exe file to know of changes inside AutoCad.
One is an independant class 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.
Following your advice, the function that reads title sheets does this using the database and not the editor. It now (thankyou) works faultlessly when called inside AutoCad.
But if I invoke it from my exe. I get this error:-
Autodesk.AutoCAD.Runtime.Exception: eFileSharingViolation at Autodesk.AutoCAD.DatabaseServices.Database.ReadDwg
Furthermore, nothing was written to an external file, so it hasn't even got into the routine.
this part of the exception-message:
eFileSharingViolation at Autodesk.AutoCAD.DatabaseServices.Database.ReadDwg
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 ==> for analyzing that you must have your code, I can't do that for you, sorry!
Good luck, - alfred -
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.