Saturday 15 October 2016

python toolbox - Setting "Always run in foreground" within ArcPy code?


Is it possible to set the "Always run in foreground" option within ArcPy code? I haven't found anything on this yet?


It would be nice to be able to specify within a script, instead of through the Geoprocessing Options window.



Answer



This can be done in ArcPy when you are Defining a tool in a Python toolbox by using the canRunInBackground property:




If canRunInBackground is unset or set to True, the tool will respect the current Background Processing setting in the Geoprocessing Options dialog.


If set to False, the tool will always run in the foreground, overriding the Background Processing setting in the Geoprocessing Options dialog.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...