Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Progress dialog pops up after hiding it when messageBox is displayed

0 REPLIES 0
Reply
Message 1 of 1
m0d0
232 Views, 0 Replies

Progress dialog pops up after hiding it when messageBox is displayed

Hi,

 

i am probably misunderstanding the behavior of the delay argument in ProgressDialog.show() method.

import adsk.core, adsk.fusion, adsk.cam, traceback
from time import sleep

def run(context):
    ui = None

    ITERATIONS = 10
    TIME_PER_ITERATION = 0.05
    DELAY = 1
    
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        
        progressDialog = ui.createProgressDialog()
        progressDialog.show('title','percentage %p\nvalue: %v\nmaximum: %m',0,ITERATIONS,DELAY)

        for i in range(ITERATIONS):
            if progressDialog.wasCancelled:
                    break
            progressDialog.progressValue = i+1
            sleep(TIME_PER_ITERATION)
        
        progressDialog.hide() 

        ui.messageBox('End')

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

 

 As far as i understood the description, the progress dialog shouldn't appear at all if TIME_PER_ITERATION  * ITERATIONS < DELAY. The progress dialog doesn't appear if you are not displaying a message box after the progress. But if you are using the message box the progress dialog pops up at the moment the message box is displayed. Is this the exspected behavior? Is there a way to  'permanently' hide the progress dialog?

 

I am thankful for any ideas!

 

Labels (3)
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report