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
Solved! Go to Solution.
Solved by frosty1_4me. Go to Solution.
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)