ArcGIS Pro 2.5: How to overwrite outputs of geoprocessing tools when run in a model builder?
Despite the fact that “Allow geoprocessing tools to overwrite existing datasets” option is checked, outputs appear not be overwritten when working with model builder.
What could be the issue here?
Hi Jamal,
Wow, I have exactly the same issue, I am happy to see that I am not the only one to experiment this .
Did you find a solution ?
Hi Olivier,
I’m still waiting for some feedback from esri experts on this issue. Not sure if some of them has already explored this problem
I don't write any models, but you should be able to set an environment that allows you to over write existing data.
Take a look here: Geoprocessing environment settings—ArcGIS Pro | Documentation
I couldn’t find myself an option that allows overwriting except the one that appears in screenshots of my first post.
For example, if the cell size the in the “Euclidian Distance” is changed, then the outputs are not replaced, instead new raster are created!
Is there a way to overwrite such that the number of outputs are kept 5 for my model?
If I'm interpreting these posts correctly, there is no way to specify that a particular/individual geoprocessing model should overwrite its outputs. The only option is to set this in the Pro options tab as shown in the first post. Is this still the case? I'm calling a lot of geoprocessing models from ArcPy and I want to allow some of the models to overwrite existing outputs. This setting in the Pro user interface is likely ignored when running a completely standalone ArcPy script.
Please confirm when you can. And ESRI, if you're reading this, please allow this option to be set within individual models.
When calling your model from arcpy, arcpy.env.overwriteOutput should be set to True. Is this not working? Often in the desktop apps it is common for a layer to not easily release file locks (regardless of overwrite setting), lots of bug fixes of that through the years.
When running standalone outside of the desktop app, there aren't data layers in the interface (just in memory when created) so these problems are less likely - IF you make sure the environment overwriteOutput is set to True in your code.
Thanks for the suggestion. I just tried arcpy.env.overwriteOutput = True and it does work.
Is there a way to write this as a custom script tool and pop it into an existing Model? The model I'm creating has to be able to be used in the GP pane as a 'tool'.