hexagon logo

Automation Issue with .NET

When opening and executing PC-DMIS programs from a Windows VB.Net application, on SOME machines SOME of the time, the main PC-DMIS window will not display.
Only the PC-DMIS Execution Window is displayed - PC-DMIS User Prompts are essentially unavailable. In this case, closing PC-DMIS via task manager is the only solution.

My open and Execute construct are (essentially) the following:

PCDMISapplication = New PCDLRN.Application
PCDprograms = PCDMISapplication.PartPrograms
PCDMISapplication.Visible = True
PCDpartPrg = PCDMISprograms.Open(pathAndFilename, machineName)
Threading.Thread.Sleep(2000) ' Wait while program opens
PCDMISapplication.WaitUntilReady(200)
PCDpartPrg.Visible = True
PCDpartPrg.EXECUTE()


I suspect the solution is to add a variable the Thread.Sleep() and WaitUntilReady() methods and increase the times until this stops. But that doesn't explain the random nature.

Another Thought: Since I'm also handling some PartProgram Object events, I'm tempted to put the PCDpartPrg.Visible = True in a regularly fired event. But this seems like wikkid overkill. Again, I'd just like to understand the nature of this random problem.

Any thoughts?

Thanks,
Dan (in DFW - supposedly)
Parents
  • When opening and executing PC-DMIS programs from a Windows VB.Net application, on SOME machines SOME of the time, the main PC-DMIS window will not display.
    Only the PC-DMIS Execution Window is displayed - PC-DMIS User Prompts are essentially unavailable. In this case, closing PC-DMIS via task manager is the only solution.

    My open and Execute construct are (essentially) the following:

    PCDMISapplication = New PCDLRN.Application
    PCDprograms = PCDMISapplication.PartPrograms
    PCDMISapplication.Visible = True
    PCDpartPrg = PCDMISprograms.Open(pathAndFilename, machineName)
    Threading.Thread.Sleep(2000) ' Wait while program opens
    PCDMISapplication.WaitUntilReady(200)
    PCDpartPrg.Visible = True
    PCDpartPrg.EXECUTE()
    


    I suspect the solution is to add a variable the Thread.Sleep() and WaitUntilReady() methods and increase the times until this stops. But that doesn't explain the random nature.

    Another Thought: Since I'm also handling some PartProgram Object events, I'm tempted to put the PCDpartPrg.Visible = True in a regularly fired event. But this seems like wikkid overkill. Again, I'd just like to understand the nature of this random problem.

    Any thoughts?

    Thanks,
    Dan (in DFW - supposedly)


    Dan, I'm a complete idiot when it comes to VBA but it sounds like to me that some machines are being forced into operator mode. I know there is actually a VBA registry setting for Blade Runner but I'm not sure how you would go about finding a solution to this for your problem if in fact this is what's going on.
Reply
  • When opening and executing PC-DMIS programs from a Windows VB.Net application, on SOME machines SOME of the time, the main PC-DMIS window will not display.
    Only the PC-DMIS Execution Window is displayed - PC-DMIS User Prompts are essentially unavailable. In this case, closing PC-DMIS via task manager is the only solution.

    My open and Execute construct are (essentially) the following:

    PCDMISapplication = New PCDLRN.Application
    PCDprograms = PCDMISapplication.PartPrograms
    PCDMISapplication.Visible = True
    PCDpartPrg = PCDMISprograms.Open(pathAndFilename, machineName)
    Threading.Thread.Sleep(2000) ' Wait while program opens
    PCDMISapplication.WaitUntilReady(200)
    PCDpartPrg.Visible = True
    PCDpartPrg.EXECUTE()
    


    I suspect the solution is to add a variable the Thread.Sleep() and WaitUntilReady() methods and increase the times until this stops. But that doesn't explain the random nature.

    Another Thought: Since I'm also handling some PartProgram Object events, I'm tempted to put the PCDpartPrg.Visible = True in a regularly fired event. But this seems like wikkid overkill. Again, I'd just like to understand the nature of this random problem.

    Any thoughts?

    Thanks,
    Dan (in DFW - supposedly)


    Dan, I'm a complete idiot when it comes to VBA but it sounds like to me that some machines are being forced into operator mode. I know there is actually a VBA registry setting for Blade Runner but I'm not sure how you would go about finding a solution to this for your problem if in fact this is what's going on.
Children
No Data