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

ReadDwgFile fatal error Map3d 2014

1 REPLY 1
SOLVED
Reply
Message 1 of 2
frosty1_4me
419 Views, 1 Reply

ReadDwgFile fatal error Map3d 2014

Hi,

 

I'm trying to open a file in vb.net to read some of the xrefs within it, and I have narrowed down the fatal error that is being generated by the following code.   I have tried both of the differences I have listed below and both produce a fatal error when the ReadDwgFile is envoked.  Can someone tell me why that may be happening?

 

 Dim myDB As New Autodesk.AutoCAD.DatabaseServices.Database
        myDB.ReadDwgFile(dwgfile, FileOpenMode.OpenForReadAndWriteNoShare, False, "")

 

Or this:

 Dim myDB As New Autodesk.AutoCAD.DatabaseServices.Database
        myDB.ReadDwgFile(dwgfile, IO.FileShare.ReadWrite, True, "")

 

Thanks

1 REPLY 1
Message 2 of 2
frosty1_4me
in reply to: frosty1_4me

I solved my issue thanks to this post here

 

I'm no pro at the new .Net api so I'm still muddling my way around.  however, the issue appears to be how I was creating the db.   The change I made is shown below which has solved my issue:

 

Dim myDB As New Autodesk.AutoCAD.DatabaseServices.Database(False, True)       

 

myDB.ReadDwgFile(dwgfile, FileShare.ReadWrite, False, String.Empty)

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