In Model Builder, does "Overwrite Geoprocessing operation products" apply?

3806
7
Jump to solution
03-11-2019 04:55 PM
SarahMcCabe
New Contributor III

I am writing a Model in Model Builder where I iterate through a Feature Class of points to create a series of buffers, then the buffer clips a small section of a Digital Elevation Model to be used for the Points Solar radiation.  I want to sequentially create and discard the buffer, use Points Solar Radiation, and then go on to the next point and buffer it.

In my ArcMap project Geoprocessing options, I have "Overwrite the outputs of Geoprocessing operations" checked.  Sometimes when I run my model I get the error 00258 "Feature class already exists."    What can I do about this?

Tags (1)
1 Solution

Accepted Solutions
curtvprice
MVP Esteemed Contributor

If you have add to display for this feature class turned on, disable it. That could help, though this fix hasn't always consistently worked for me.

One approach I have used to solve the issue is to run the Delete tool on the temporary dataset you want to overwrite, with a precondition connecting the output a tool (buffer, Clip) to the Delete.  The precondition forces the Delete to happen only after the intermediate dataset is not needed. 

If the buffer dataset is reasonably small, I would hard-code the path of this intermediate dataset to be in_memory, for example: in_memory\xbuf.

View solution in original post

7 Replies
curtvprice
MVP Esteemed Contributor

If you have add to display for this feature class turned on, disable it. That could help, though this fix hasn't always consistently worked for me.

One approach I have used to solve the issue is to run the Delete tool on the temporary dataset you want to overwrite, with a precondition connecting the output a tool (buffer, Clip) to the Delete.  The precondition forces the Delete to happen only after the intermediate dataset is not needed. 

If the buffer dataset is reasonably small, I would hard-code the path of this intermediate dataset to be in_memory, for example: in_memory\xbuf.

SarahMcCabe
New Contributor III

Hi Curtis -

I turned off "Display Feature Class" in Geoprocessing Options, and that appears to have solved the issue.  But this means I will have to make a note about it in the Tool Description, because I hope to share this with other people.  

Mega-Thanks!!!

SarahMcCabe
New Contributor III

Now I find that my model goes past the buffer problem when it is in "Edit" Mode, but not when it just "Open" to put in different parameters.  A mystery!

0 Kudos
curtvprice
MVP Esteemed Contributor

Sarah,

I think this is because in Edit mode, when a dataset is created by the model, a layer is created and added to ArcMap's memory (especially when 'add to display' is checked). This is causing a problem when you try to delete it because the dataset is "locked" by the existing layer. This does not happen when running a model as a tool (ie Open mode).

Glad my response helped. If you think my response was good enough to be a 'correct answer', please mark it as correct so others with the same issues can find it easily.

0 Kudos
curtvprice
MVP Esteemed Contributor

Sarah, I tried to branch your discussion and accidentally deleted your reply. 

In answer to your comment, which I deleted sorry! --- 

Add results to geoprocessing display in geoprocessing options means when you run a tool the output is added to the map. You can turn that off.

Add to Display model element property in Model Builder edit mode is different, this setting only applies when running a model inside edit mode. If you click it off, MB will indeed attempt to remove that model element from the ArcMap data frame if it can locate it. Or add it back to the map if you turn it on and it exists.

and, Managed is a model element property setting in MB which tells Model Builder to figure out where to write intermediate datasets. This is an older approach that has been around since the early days of Model Builder, I have found that I have better luck by writing intermediate data to the locations %scratchGDB%, %scratchFolder%, and in_memory.

Making intermediate data managed data—Help | ArcGIS Desktop 

0 Kudos
SarahMcCabe
New Contributor III

I will paste back the two illustrations of where to turn off "Add to Display"  - the first in Geoprocessing options, the second accessed in the Model Builder Edit mode, by right-clicking the product of the function that should be over-written.  The point is that when they are automatically added to the Display, they can have a lock that prevents them from overwriting.Geoprocessing options - add to DisplayAdd To Display for a Function product

curtvprice
MVP Esteemed Contributor

That is great to have that clarified in the thread! Thanks for re-posting the screenshots.

0 Kudos