Message 1 of 3
Progress dialog not hiding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I have encountered some problems while using the progress dialog in my add-in. The progress dialog is not hidden when the delay is longer than the progress itself.
For example, I have tested this in a simple block of code below:
# This event handler is called when the user clicks the OK button in the command dialog or
# is immediately called after the created event not command inputs were created for the dialog.
def command_execute(args: adsk.core.CommandEventArgs):
# General logging for debug.
futil.log(f'{CMD_NAME} Command Execute Event')
# TODO ******************************** Your code here ********************************
func1()
def func1():
global progDiag
if not progDiag:
progDiag = ui.createProgressDialog()
progDiag.cancelButtonText = 'Show'
progDiag.show(
'Test',
'f1: Running: %p%',
0,
5,
8
)
for i in range(5):
time.sleep(1)
progDiag.progressValue += 1
progDiag.hide()
The progress takes 5 seconds but I set the delay to be 8 seconds. After running this in an add-in, the progress dialog is not hidden.
Does anyone have an idea on how to avoid this issue?
Thanks a lot!