.NET

Reply
Valued Contributor
frosty1_4me
Posts: 54
Registered: ‎11-13-2006
Message 1 of 2 (108 Views)
Accepted Solution

ReadDwgFile fatal error Map3d 2014

108 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

Valued Contributor
frosty1_4me
Posts: 54
Registered: ‎11-13-2006
Message 2 of 2 (101 Views)

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)

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community