I am having trouble overwriting an output shapefile from ModelBuilder.

The model works great when ran the first time, but I get an '000210 : Cannot create output .' error if I re-run the model. The error states 'The output cannot be created. Potential reasons include data locking, an incorrect path, and limited access rights..'

I've noticed that there is a .lock file associated with the shapefile so I assume this is my problem. I've checked the overwrite outputs of geoprocessing options checkbox in the geoprocessing options.

My model is very simple, I am just using a multivalue iteration to buffer a line segment at different buffer widths and then clipping to a polygon. I am using the inline variable subsitution based off of the buffer value for my output shapefile name.

Anybody know how to fix this? or possible work arounds? I am using ArcMap 10.2

  • Are you resetting the model between runs by Validating the entire model before rerunning? The only other thing I can think is if, because it's a shapefile, once added to the map it becomes a separate locked entity in which case just removing that layer from display should unlock it and allow overwriting. ArcGIS sometimes has trouble letting go of things though. – Chris W May 2 '14 at 19:28
  • Hi Chris. Have tried your suggestions but still the lock file remains! I think you're right, ArcGIS is having a hard time lettting go!! – ChrisA May 2 '14 at 20:00
  • 1
    Have repeatedly and consistently had the same kind of issue on occasion with data in SHP, PGDB, & FGDB. Certain tools and iterators, as best I can figure out, create locks on data that don't release when model's closed. If run from within ArcMap, the locks aren't dropped until arcmap's closed. Same for arccatalog. Only work around I've found is to call the model from within arcpy (do this via python directly, not python window in arcgis) and run the model there. That way you just have to close IDLE/pywin/etc. and all locks should be dropped. Not ideal, but best work-around I've found. – John May 2 '14 at 20:57
  • Thanks John, I believe you are correct that some tools/iterators create locks and there is no way of losing them without closing ArcMap. Other options I guess, are to delete each shapefile through the ArcCatalog window... what a pain! – ChrisA May 2 '14 at 21:32
  • 1
    You say "My model is very simple" - can you use the edit button beneath your Question to revise it with a more detailed description and graphic(s) which will enable us to try and recreate it as a test, please? At the same time you could revise it with any other clarifications that have come out of the Comments so far. Keeping your Question "standalone" rather relying on potential answerers to assimilate a Comment trail using leads to quicker and better answers. – PolyGeo May 4 '14 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.