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
  • 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.


    Loop your code non-stop! As soon as the operator opens the Edit window the loop should be coming around the bend to hide it again before operator can even distinguish the text in the Edit window. Not the best solution but a multi threader never hurt no one.

    Edit:
    Grab a hold of the window handle and simulate the exit button (they're not 'send-keys' though). Did something similar though it was to use the ESC key to exit absolutely anything sub-menu opened in PcDmis like it would in MasterCam, Solidworks, etc everyone else!

    Use of Microsoft Spy++ and http://www.pinvoke.net/ should get you moving quickly.

    Here's more: https://www.codeproject.com/Articles/141842/Automate-your-UI-using-Microsoft-Automation-Framew

    It's called "UI Automation" btw I just remembered.
Reply
  • 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.


    Loop your code non-stop! As soon as the operator opens the Edit window the loop should be coming around the bend to hide it again before operator can even distinguish the text in the Edit window. Not the best solution but a multi threader never hurt no one.

    Edit:
    Grab a hold of the window handle and simulate the exit button (they're not 'send-keys' though). Did something similar though it was to use the ESC key to exit absolutely anything sub-menu opened in PcDmis like it would in MasterCam, Solidworks, etc everyone else!

    Use of Microsoft Spy++ and http://www.pinvoke.net/ should get you moving quickly.

    Here's more: https://www.codeproject.com/Articles/141842/Automate-your-UI-using-Microsoft-Automation-Framew

    It's called "UI Automation" btw I just remembered.
Children
No Data