How do you get the SetProgressor() to actually display?

3649
9
01-23-2012 08:13 AM
JeremyRead
New Contributor II
I have tried running my Python script in both PythonWin and a regular window, and it doesn't show up either way.

arcpy.SetProgressor("step", "Processing...")

do stuff...

arcpy.SetProgressorPosition(3)


Do I actually have to "print" it somehow?
Tags (2)
0 Kudos
9 Replies
curtvprice
MVP Esteemed Contributor
In a stand-alone script, your script isn't being called from an ArcGIS application, so there is no progress dialog box, result, or Python window where your messages can be viewed.



Arc 10 Help: Writing messages in script tools
0 Kudos
JeremyRead
New Contributor II
Ah, gotcha.  Thanks!

The example in Desktop Help for SetProgressor() didn't really mention anything about that.  I appreciate the link for help with messages 🙂
0 Kudos
JeremyRead
New Contributor II
OK, well... I spoke too soon.  I looked at the help that you linked and I still don't really get it.  I still don't see how to tell it to display the step progressor each time it updates (steps).
0 Kudos
curtvprice
MVP Esteemed Contributor
OK, well... I spoke too soon.  I looked at the help that you linked and I still don't really get it.  I still don't see how to tell it to display the step progressor each time it updates (steps).


The help I linked is about printing messages -- which is what you have to do in scripts not run as a toolbox's script tool.

The help for SetProgressor has a code sample at the bottom on how to update progressor messages and the progressor "bar graphic".

I've found that sometimes progressor messages from tools you are running (especially spatial analyst tools) trump your progressor settings. In those cases the progressor doesn't always do exactly what you want.
0 Kudos
BlakeTerhune
MVP Regular Contributor

Have you found any way to override or supress these other progressor messages from Esri?

0 Kudos
curtvprice
MVP Esteemed Contributor

No. But, this is a little bit moot as the progressors are not out front anymore (ArcMap background processing, Pro).

0 Kudos
JeremyRead
New Contributor II
The help I linked is about printing messages -- which is what you have to do in scripts not run as a toolbox's script tool.

The help for SetProgressor has a code sample at the bottom on how to update progressor messages and the progressor "bar graphic".

I've found that sometimes progressor messages from tools you are running (especially spatial analyst tools) trump your progressor settings. In those cases the progressor doesn't always do exactly what you want.


I must have an issue on my machine or something.  My script is setup to work just like the example.  I even copied/pasted the example and ran it on my own machine (double-clicked the script icon) and it worked, but I saw nothing.
0 Kudos
LoganPugh
Occasional Contributor III
SetProgressor only takes effect when you run the script as a script tool from within an ArcGIS application (ArcMap, ArcCatalog, etc.). Running it standalone or from a Python IDE/interpreter, it will not display the progress dialog.
JeremyRead
New Contributor II
SetProgressor only takes effect when you run the script as a script tool from within an ArcGIS application (ArcMap, ArcCatalog, etc.). Running it standalone or from a Python IDE/interpreter, it will not display the progress dialog.


Ok, thank you.  I guess I will need to find a different method.