Basic Model Won't Overwrite Existing Data

7961
15
Jump to solution
06-27-2016 08:20 PM
BenVan_Kesteren1
Occasional Contributor III


Hi,

I have a model I created in Model Builder that simply runs several instances of the "Feature Class to Shapefile" tool.

If I run this tool over and over again, it keeps creating new files in the output directory, incrementing the filename by a single digit each time.

For example, if I run the tool three times I will end up with:

  1. Water_mains.shp
  2. Water_mains_1.shp
  3. Water_mains_2.shp

Is there a way I can tell the model builder to overwrite these files instead of creating a unique file name?

I reference these files in several maps, and I thought I was updating the source data for these maps, but each time I run it it creates a new filename so the data source needs to be updated accordingly (not ideal).

Do you know how to force the model to overwrite existing data?

Tags (1)
1 Solution

Accepted Solutions
JayantaPoddar
MVP Esteemed Contributor

In ArcMap, click Geoprocessing > Geoprocessing Environments.

Check the first option "Allow Geoprocessing tools to overwrite existing datasets".



Think Location

View solution in original post

15 Replies
JayantaPoddar
MVP Esteemed Contributor

In ArcMap, click Geoprocessing > Geoprocessing Environments.

Check the first option "Allow Geoprocessing tools to overwrite existing datasets".



Think Location
curtvprice
MVP Esteemed Contributor

You can also set Overwrite outputs as in the properties/environment tag of the model (so the user doesn't have to do it in ArcMap for everything).

JoeBryant2
Occasional Contributor II

Curtis, could you be more specific? I don't see this option anywhere when I right-click my model > Model Properties > Environments > ?

FYI: 10.4.1

curtvprice
MVP Esteemed Contributor

You are right, Joe, overwrite outputs can only be set at the application level (ArcMap > Geoprocessing > Options) or in Python scripting. Sorry.

JamalNUMAN
Legendary Contributor

This appear not work in Pro 2.5.

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
curtvprice
MVP Esteemed Contributor

Jamal, I don't see any thing in your screen shot that is "not working".  Maybe you could describe your problem better?

It is true that sometimes one tool or another does not handle overwrite well, but for me overwrite output has been working a little more consistently than it does in ArcMap, mostly because Pro is a single application (as opposed to futzing with file locks caused by using ArcMap and ArcCatalog at the same time). 

Though a common problem in Pro is that since it is multi threaded, you can have a feature class or field list open for editing when you try to run a tool and run into a file lock error. The fix is to go to the edit menu and save or reject your changes, this will remove the file lock so you can overwrite your output.

JamalNUMAN
Legendary Contributor

Thanks Curtis.

 

The model shown in the screenshot below, is assumed to deliver “5” outputs. Currently, each time any parameter is modified in any of the tools that participate in the model leads to creating new output for that tool instead of replacing the previous output.

 

In the second screenshot, the number of outputs are more than “5”. I assume that the number of outputs for this model should be kept “5” if the outputs are overwritten.

 

Am I correct?

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
BenVan_Kesteren1
Occasional Contributor III

Hey Jayanta,

thanks for the comment, it seems I already have this option ticked on....

These are the current settings I have in ArcMap:

2016-06-29 095644 Weave_Main.mxd - ArcMap.jpg

These are the current settings I have in ArcCatalog (this is where I open the Model Builder model from):

2016-06-29 095441 ArcCatalog - GIS Servers.jpg

BenVan_Kesteren1
Occasional Contributor III

Here is a copy of the model I am using, is there a setting stored inside this?

https://dl.dropboxusercontent.com/u/32195871/Work%20Only/GeonetExport.zip