hexagon logo

Start PC-DMIS in Operator Mode via Code

I would like to start PC-DMIS in operator mode, specifically to disable the Edit Window. Here is the snippet of the C# code:
app = (PCDLRN.Application)Activator.CreateInstance(Type.GetTypeFromProgID("PCDLRN.Application"));
progs = app.PartPrograms;
events = app.ApplicationEvents;
app.Visible = true;
app.OperatorMode = true;

Unfortunately, the user can still open the Edit Window (View -> Edit Window) to make changes to the program. Does anyone have a sample code that does what I'm trying to do?

Thanks.
Parents
  • Based on your comment, I have found a solution. Instead of looking for "app = null", one needs to look for "app.Visible = false" and then trigger a computer to sign out. This is because when launching PCDMIS via automation with AutomationStartupOptions.txt, PCDMIS does not truly "exit" when exiting. Instead PC-DMIS becomes a background process, and when it happens, app.Visible = false. Problem solved!
Reply
  • Based on your comment, I have found a solution. Instead of looking for "app = null", one needs to look for "app.Visible = false" and then trigger a computer to sign out. This is because when launching PCDMIS via automation with AutomationStartupOptions.txt, PCDMIS does not truly "exit" when exiting. Instead PC-DMIS becomes a background process, and when it happens, app.Visible = false. Problem solved!
Children