cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

About the pause function for repetitive tasks

CHASEONHO
18-Opal

About the pause function for repetitive tasks

Hi,

I am trying to implement a repetitive tasks that opens a listed drawing in a new window and exports it in a different format. and that it can be stopped during repetitive tasks.

 

Work scenario)

The repetitive tasks is implemented with a "for" loop, and the task of opening and exporting the drawing is temporarily implemented with the "EmptyWindowCreateAndDelete" function.

 

use a window procedure to respond to the user to stop during the task. When the window procedure window is closed, the loop stops.

 

This function is effective in loops. The TEST2 function works only with the loop without EmptyWindowCreateAndDelete, and when the user closes the window, the loop seems to stop in the middle.

However, when used with a function that creates a new window like EmptyWindowCreateAndDelete, the window procedure does not respond to the user's click.

Is there a better way to stop during the looping task, or is there a way to make the window procedure respond to the user's click even when a new window is created?

 

Note. I have attached the video and the entire code.

2 REPLIES 2

You may need to activate the dialogue in the for loop to allow the X button to be clicked. It looks like you're creating your UI using a Windows Form, so I'm not exactly sure how to do this.

I normally create Creo Toolkit UIs using the CreoUIEditor and then use ProUIDialogActivate in the for loop to activate the dialogue to allow the buttons to be clicked. In Creo 10, you can find the CreoUIEditor here: "C:\Program Files\PTC\Creo 10.0.X.0\Common iles\applications\creouieditor\bin\creo_ui_editor.bat".

 

Using ProUIDialogActivate in the for loop has a lot of benefits:

  • User can click the Stop or X buttons to exit the for loop.
  • Status and progress bar updates can be given to the user.
  • Without using ProUIDialogActivate, Creo will often just enter a busy "spinning circle" mode until the for loop completes and ProMessageDisplay stops working to give the user status updates. There may be some other way to get ProMessageDisplay to reliably work in for loops but using ProUIDialogActivate has worked for me.

Here's an example:

lhoogeveen_0-1734628970727.png

RPN
17-Peridot
17-Peridot
(To:CHASEONHO)

Why not a-synchronous with hidden graphics, next a simple button for stop?

Announcements


Top Tags