I'm experimenting with the export model to python function in Model Builder. I've found that when exported, line 10 in the python script shows
arcpy.env.overwriteOutput = False
Is there anyway in Model Builder to preset this to equal True instead? When I run the model in Model Builder, this doesn't seem to be an issue, but in the python script, if I leave it as False, the script fails to run due to what I beleive is Intermediate data that hasn't been cleared after a previous iteration.
Solved! Go to Solution.
Even though overwriteOutput is an environment variable in arcpy, it is not one in ArcGIS Pro. It is an option: Options - Geoprocessing - Allow geoprocessing tools to overwrite existing datasets. Unfortunately the model export does not respect the choice from the options. I don't know of anyway to fix this.
See here for an idea somebody already raised about this:
Even though overwriteOutput is an environment variable in arcpy, it is not one in ArcGIS Pro. It is an option: Options - Geoprocessing - Allow geoprocessing tools to overwrite existing datasets. Unfortunately the model export does not respect the choice from the options. I don't know of anyway to fix this.
See here for an idea somebody already raised about this:
Thanks for the additional context. I've added my kudo to the post.