I have to open the files which are converted from Unigraphics NX6, and run some routines, but I am not able to open the Autocad through .net api, my code is as follows
Dim Filename As String = OpenFileToConvert.FileName ' I am selecting the Dwg through OpenFileDialog
Dim acDocMgr As DocumentCollection = Autodesk.AutoCAD.ApplicationServices.Application.D
Even if I open the dwg manually and then save it again to Autocad, I am not able to achieve any success.
And I would be glad if someone suggests me a code to work with, without open the file at all.
Herewith I am attaching the sample file which I am not able to open through vb.net in Autocad.
Solved! Go to Solution.
Using AutoCAD 2012, I do not have issue opening your drawing manually, or by code like this:
or read it into a database (i.e. not open the drawing in editor):
using (Database db=new Database(false, true))
db.ReadDwgFile(@"C:\Temp\Model1.dwg", FileOpemMode.OpenForReadAndAllShare, true, null);
Try add CommandFlags.Session to your command method
I can't rich at AutoCad today, sorry
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.