About the pause function for repetitive tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Chapters
- descriptions off, selected
- captions settings, opens captions settings dialog
- captions off, selected
- default, selected
This is a modal window.
Beginning of dialog window. Escape will cancel and close the window.
End of dialog window.
This is a modal window. This modal can be closed by pressing the Escape key or activating the close button.
However, when used with a function that creates a new window like EmptyWindowCreateAndDelete, the window procedure does not respond to the user's click.
- Chapters
- descriptions off, selected
- captions settings, opens captions settings dialog
- captions off, selected
This is a modal window.
Beginning of dialog window. Escape will cancel and close the window.
End of dialog window.
This is a modal window. This modal can be closed by pressing the Escape key or activating the close button.
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.
- Labels:
-
ProToolkit
-
Toolkit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@lhoogeveen Thanks your reply,
but, Our tool is synchronous toolkit and in this case I cannot click a button in the middle of a FOR-LOOP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
naive suggestion ... create independent simple application which creates %TEMP%\stop_for_loop.txt file and inside your FOR loop check whether this file exist.
Martin Hanák
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Our Toolkit applications are all synchronous and the method above works just fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @CHASEONHO ,
I wanted to see if you got the help you needed.
If so, please mark the appropriate reply as the Accepted Solution or please feel free to detail in a reply what has helped you and mark it as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation.
Thanks,
PTC Community Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Why not a-synchronous with hidden graphics, next a simple button for stop?
