Bill Tillman Posted June 23, 2014 Share Posted June 23, 2014 For the last few years I've been using this code in VB.NET to open a drawing in AutoCAD. This works great and it looks for an existing instance to use before opening a new one: Dim vAcadApp As AcadApplication Dim vAcadDoc As AcadDocument Try If Process.GetProcessesByName("acad").Length > 0 Then vAcadApp = GetObject(, "AutoCAD.Application.19") Else vAcadApp = New AcadApplication End If vAcadApp.Visible = True vAcadApp.WindowState = AcWindowState.acMax vAcadDoc = vAcadApp.Documents.Open(DwgPath & DwgName, True) We've now begun working more with C# so I'm searching for how to do this very same thing but in C#. And there is one other caveat on this I must deal with. This will be run at the users' desktop and we have various versions of AutoCAD running. Some 2009's sprinkled here and there but mostly 2013 and 2014. I'm fearing that this will make loading the appropriate reference a complicated task. 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.