Autocad

  • Thread starter Thread starter john m
  • Start date Start date
J

john m

i want to write a vb dotnet program to

see if autocad is running
and if not start it
then just start to manipulate the application

what is the correct method to do this?

can anyone point me to some sample code?

thanks
jm
 
I have worked on similar projects like this in the past.

To find out if a process is running I normally use this method:
Dim localAll As Process() = Process.GetProcesses()
For i As Integer = 0 To localAll.GetUpperBound(0)
If localAll(i).ProcessName = "Your Process Name Here" Then
End If

If it is not running then you can launch your program with the
System.Diagnostics.Process.Start("c:\Autocad.exe") 'Or whatever

When you say manipulate the program it all depends on what you want to
do. If the AutoCAD method can be written in a shell format like
autocad.exe /? (Shows Help) then you could shell out to the exe.
otherwise you may have to use sendkeys procedures. Send keystrokes
programmatically that will automatically complete your task.

If you need to use a mouse to accomplish this task there are activex
components out there that will allow you to pass mouse-screen
coordinates to the screen to accomplish your tasks.
Hope that helps.

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top