2

At ArcGIS Desktop (advanced) 10.3.1, I've created a model that simply copies a file geodatabase. Both the source and target locations are parameterized. Here's a screen shots of the model:

enter image description here

And here it is in action:

enter image description here

Here's my problem: the tool overwrites any pre-existing .gdbs with the same name in the target path. I want to modify the tool so that it notifies the user prior to overwriting. How can this be done? Nothing in the Copy tool instructions or environment settings solves the problem.

  • 2
    In Geoprocessing Options, is Overwrite the outputs of geoprocessing operations enabled? – Paul Feb 27 '17 at 23:33
  • 1
    How have you defined your output parameter? When I try it I either get an error telling me it already exists and I can't overwrite it, or a warning telling me if I proceed the existing gdb will be overwritten (based on the setting @Paul mentions above). – Midavalo Feb 27 '17 at 23:44
  • If you aren't scared of python you can use the tool validator resources.arcgis.com/en/help/main/10.2/index.html#//… with arcpy.Exists resources.arcgis.com/en/help/main/10.2/index.html#//… the tricky part is issuing a message at that time... you will need to use either PyWin32, QT or similar to issue a message box, both of these are 3rd party and may not necessarily be installed on every workstation that intends to use the tool. – Michael Stimson Feb 28 '17 at 0:11
  • Unchecking Geoprocessing options > Overwrite the outputs... solves my problem! I'm not a Python expert, but will look into that by converting my model to Python. Thanks all. – Stu Smith Feb 28 '17 at 0:24
2

There is an option in Geoprocessing Options where you can choose whether to Overwrite the outputs of geoprocessing operations or not.

enter image description here

If I uncheck this option, I get an error when I try to run my tool telling me the output already exists

enter image description here

And if I check the option, I get a warning notifying me that the output already exists, but will overwrite if I click OK to run the model.

enter image description here

If you are not seeing this warning/error when you populate your MY_NEW_PROJECT parameter, it may be because your cursor is still in the field. Tab or click out of the field to see if that warning appears.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.