.NET

Reply
Valued Contributor
100 Posts
2 Kudos
Registered: ‎11-13-2006
Post 1 of 2
Accepted Solution

ReadDwgFile fatal error Map3d 2014

159 Views, 1 Replies
03-07-2014 10:11 AM

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

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)

Valued Contributor
100 Posts
2 Kudos
Registered: ‎11-13-2006
Post 2 of 2

Re: ReadDwgFile fatal error Map3d 2014

03-07-2014 10:54 AM 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)

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!