.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Programmatically Open a Drawing

0 REPLIES 0
Reply
Message 1 of 1
alex_b
410 Views, 0 Replies

Programmatically Open a Drawing

Hi,

My program reads dwg files into a side database to read information, like so:

db.ReadDwgFile(fName, FileShare.ReadWrite, false, "");

 Based on that information, the program has to open a dwg file in the Editor:

DocumentCollection dm = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager;
try
{
	dm.Open(fName, false);
}

 The problem I'm encountering is this:

If I use a modal dialog in the document context, I get "Invalid execution context" error when trying to open the file in the editor.

On the other hand, if I use a modeless dialog in the Application context, trying to read a dwg into the side database gives "eNoInputFiler" error.

I suppose this is related to the execution context, but I haven't been able to make it work.

(the xref dialog in AutoCAD succeeds though)

Any help will be much appreciated.

 

alex

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost