Hello, I'm having a similar problem. We have a web appliaction that will create a 2D array, then launch my .dll and pass it the array. My code is supposed to launch AutoCad and then create a drawing using the info passed in the array.
I also want to check to see if AutoCad is running already.
Thanks in advance for your help
Public Function isAutocadOpen() As Boolean Dim rtnValue As Boolean Dim ProcessList As System.Diagnostics.Process() Dim Proc As System.Diagnostics.Process ProcessList = System.Diagnostics.Process.GetProcesses() Try For Each Proc In ProcessList If UCase(CStr(Proc.ProcessName)) = UCase("acad") Then MsgBox(Proc.Id.ToString) rtnValue = True End If Next Catch ex As Exception End Try Return rtnValue End Function
Again, thanks for the code. I was also wondering if you could give me the command that will launch AutoCad if it's not currently running. I don't normally ask for stuff like this, but I've looked all over and found many convoluted websites or sites that I needed to have a phd in programming to understand.
Please look for the usage of "Activator.CreateInstance" as in this blog post :
In the sample code from the blog post, remember to change the progId based on the version of AutoCAD that you want to launch. For example : "AutoCAD.Application.19" for AutoCAD 2013.
Access a broad range of knowledge to help get the most out of your products and services.
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.
Upgrading to a 2015 product? Make sure to check these out 1st!