2

I'm programming a python toolbox (*.pyt) and want to display a progressbar in arcgis 10.3. I'm using the same piece of code as this one, but I can't see the same dialog box as above. I can only see the messages updating in the geoprocessing "results" window. I also tried to add my Pyt to the toolbox window, but this didn't solve this issue.

Is this progressor class only working for python script, and not for python toolbox ?

  • 1
    What value is this setting in your PYT : canRunInBackground ? – KHibma May 15 '17 at 13:50
  • 1
    Welcome to GIS SE! Thank you for taking the new user tour. I have added a brief answer explaining how to display that progress dialog, however it's hard to offer any more help without seeing some test code. Please edit your question to include a test PYT as text (not an image) of what you've tried. – Midavalo May 15 '17 at 13:55
4

To see the progress dialog as seen in the linked Q&A you need to have self.canRunInBackground = False set in your PYT code. This will force your tool to run in the foreground with that dialog showing.

See Defining a tool in a Python toolbox

class CalculateSinuosity(object):
    def __init__(self):
        self.label = "Calculate Sinuosity"
        self.description = "Sinuosity measures the amount that a river meanders within its valley, " + \
                           "calculated by dividing total stream length by valley length."
        self.canRunInBackground = False

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.