4

I am looking for a way to access a GP tool running in a Python script to be able to see how much of the job has already been done.

I have found SetProgressor function, but this one is available only when running script tools via ArcGIS Desktop GUI. I am in contrary interested in obtaining the information on the progress via the code. This is to be able to track on the execution of the tool (this will be reported to a user which has triggered running the code). I don't run the code inside the ArcGIS Desktop application session.

So, for instance, when calling the Buffer GP tool on a polygon feature class (via arcpy.analysis.Buffer), I want to get an estimate from the tool after several seconds how much (in %) of the work was already done and this information should be possible access via the code.

5

You can't get this information as the Python script will block until the tool has finished running.

  • 2
    ArcGIS server geoprocessing services can be called asynchronously. However, I doubt that it is possible to get any progress via the results-object when polling the status of the job from standard tools. – Stefan Oct 16 '14 at 7:37
  • 1
    @Stefan True, the result object doesn't include any way to access the progressor. – Jason Scheirer Oct 16 '14 at 14:48
  • @JasonScheirer, thank you. Any other suggestions on how this kind of logic could be implemented with arcpy/Python? Or at least something close? – Alex Tereshenkov Oct 17 '14 at 7:20
  • @AlexTereshenkov you could go the comtypes and invoke GP tools via ArcObjects. If you implement your own TrackCancel object you get feedback as the tool executes. You could also look into the GeoprocessorEvents sink. – Jason Scheirer Oct 17 '14 at 14:42

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.