hexagon logo

VB code/ If a program is running

Does anyone know what code would be used to find out if a program is currently running in PC-Dmis? I wrote some code to automate the execution process and if I use it while a program is running, it closes the program and opens the new program while the original program continues to run. (Not sure for how long though. I stopped it after I tested it.)
Parents
  • So I figured out where the issue lies. If I open PC-Dmis through the script and do all of my code, everything works as intended. All code runs inside of the events and no server busy error happens. The problem is, since I want try operator mode to open, I am opening PC-Dmis through the .exe

    Process.Start("C:\Program Files\Hexagon\PC-DMIS 2017 R2 64-bit\PCDLRN.exe", "/o")


    This gives me the correct operator mode. Since I basically open PC-Dmis with the script at the beginning with this

    Dim oPcd As Application = New Application()


    Opening the operator mode over top of it works until I get to the events. This is when things mess up. If I quit the app and kill it in task manager after

    Dim oPcd As Application = New Application()


    Then open

    Process.Start("C:\Program Files\Hexagon\PC-DMIS 2017 R2 64-bit\PCDLRN.exe", "/o")


    after a few seconds, everything works like it should. This seems like a PITA and I'm sure there is a better way. At least I pinpointed my problem though
Reply
  • So I figured out where the issue lies. If I open PC-Dmis through the script and do all of my code, everything works as intended. All code runs inside of the events and no server busy error happens. The problem is, since I want try operator mode to open, I am opening PC-Dmis through the .exe

    Process.Start("C:\Program Files\Hexagon\PC-DMIS 2017 R2 64-bit\PCDLRN.exe", "/o")


    This gives me the correct operator mode. Since I basically open PC-Dmis with the script at the beginning with this

    Dim oPcd As Application = New Application()


    Opening the operator mode over top of it works until I get to the events. This is when things mess up. If I quit the app and kill it in task manager after

    Dim oPcd As Application = New Application()


    Then open

    Process.Start("C:\Program Files\Hexagon\PC-DMIS 2017 R2 64-bit\PCDLRN.exe", "/o")


    after a few seconds, everything works like it should. This seems like a PITA and I'm sure there is a better way. At least I pinpointed my problem though
Children
No Data