FunkyFresh Posted May 25, 2010 Share Posted May 25, 2010 We are having much trouble opening a AutoCad 2010 file in VB 2008. This is the error we get: Creating an instance of the COM component with CLSID {6D7AE628-FF41-4CD3-91DD-34825BB1A251} from the IClassFactory failed due to the following error: 80010001. For this code (code that was highlight *): Private Sub btnStartACAD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStartACAD.Click, btnStartACAD.Click 'Opens AutoCAD and makes it visible * AcadApp = New Autodesk.AutoCAD.Interop.AcadApplication AcadApp.Visible = True End Sub Quote Link to comment Share on other sites More sharing options...
RMS Posted May 28, 2010 Share Posted May 28, 2010 Would this help? Dim process As System.Diagnostics.Process Process = System.Diagnostics.Process.Start(programPath) Process.WaitForExit() Quote Link to comment Share on other sites More sharing options...
FunkyFresh Posted June 3, 2010 Author Share Posted June 3, 2010 this does work but I cant associate it with AutoCad as I would like to make it as a document to be able to draw to it, save it, etc. unless I can tie this to be an autocad app somehow... Quote Link to comment Share on other sites More sharing options...
RMS Posted June 4, 2010 Share Posted June 4, 2010 Not sure I totally understand but you may be using an older or newer library reference than the one needed; try some different ones out and or load up on a bunch.......just my guess. Quote Link to comment Share on other sites More sharing options...
FunkyFresh Posted June 4, 2010 Author Share Posted June 4, 2010 sorry, what i mean is I need to associate the process as an Acad Application. So then I can associate the running instance (or application) as an Acad Document that I could draw to and eventually save as. I came up with this code as well AcadApp = GetObject(, "AutoCad.Application") AcadApp.Visible = True ' makes it visible as it runs in the back by default but the problem with this code is its basically a lottery, sometimes it works and sometimes it doesnt Quote Link to comment Share on other sites More sharing options...
Jaikrishan Posted May 25, 2012 Share Posted May 25, 2012 public AcadApplication GetAcadApplication() { AcadApplication acApp = null; const string progID = "AutoCAD.Application"; try { acApp = (AcadApplication)Marshal.GetActiveObject(progID); } catch { try { acApp = new AcadApplication(); } catch { System.Threading.Thread.Sleep(500); acApp = (AcadApplication)Marshal.GetActiveObject(progID); } } if (acApp != null) { acApp.Visible = true; } return acApp; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.