I recently replaced ArcMap 10.3.1 on my computer with ArcMap 10.6. I created a model years ago, probably in 10.3.1, that iterates through shapefiles in a folder, changes the name of the shapefile by appending a date onto it, and then iterates through the features in the shapefile to insert that name into a field. This model has been saved on our network so multiple computers have access to it. Today, I tried to use the model in Arcmap 10.6. The tool runs and gives no error, but when the process is done the shapefiles are gone, although the new names appear in ArcCatalog! I thought somehow the tool might have gotten broken, so I tried it on another computer that is still at 10.3.1. The tool ran perfectly. I tried restarting my computer that has 10.6, but the tool still didn't work. I've looked, but I haven't seen anything about having to update tools to make them usable for 10.6? Have I missed something? How do I get this to work?
Solved! Go to Solution.
Tech Support was able to replicate the problem on their end, so they have logged a bug described as:
BUG-000114045 : When using the Model Iterator to iterate through feature classes to rename them, the first feature class is deleted after running the model as a tool.
I'm not certain that is quite the right description because if I leave off the last half of my model; the first half, which uses the iterator, runs fine. Anyhow, I don't have time to do more testing . . .
They said a "workaround" is to use ArcGIS Pro--apparently it works properly there.
No, I don't want them automatically added to the display. If, in the tool, I use the drop-down to select the folder, after the tool has run, the folder is empty. If I drag the folder into the tool from the Catalog window, after the tool has run it shows correctly re-named shapefiles, but if I try to open it, either by dragging into ArcMap or trying to look at its properties, I get "error opening file". If I look at the folder using Windows Explorer, the folder empty, and if I refresh the folder in ArcCatalog, all the shapefiles in the folder disappear; the folder is empty--the files are gone, gone, gone!
Cheryl, which tools are you using and what are the file paths?
Is this a script you have written and used in a model? or just arcmap tools?
local folders? spaces in paths? have you tried running the tool from arctoolbox rather than catalog?
You might be able to track down whether any parameters or their order changed between versions.
Thanks, Dan, for your questions.
I did not do any scripting in creating this model. It created in Model Builder using the "Iterate Feature Classes" from the ModelBuilder Tools, and "Rename" and "Calculate Field" tools from the ArcToolbox. It is in a Toolbox on a local network drive. I am using the "Iterate Feature Classes" tool with the workspace being a folder supplied as a parameter that I either browse to and click, or drag in from the Catalog window, so ArcGIS should be taking care of the path.
Then for each feature class, I take the name provided by "Iterate Feature Classes" and append a date (supplied as a parameter) using "Rename". If I run the tool while the folder is expanded in ArcCatalog, I can see the shapefiles get renamed, so it looks like it is getting this far correctly.
I then run "Calculate Field" on the output file that was produced, to insert the same name by which the file was renamed. There are no spaces or "weird" characters in the file or folder names.
Thanks for the info about the toolbox history, but it doesn't appear that is an issue. Rename and Calculate Field have not been modified since 9.3 or earlier. Unfortunately, I cannot find a similar history for the ModelBuilder Tools.
I am not sure what you mean by "have you tried running the tool from arctoolbox rather than catalog?" I have it in a toolbox on a network drive and double click on it in its toolbox in the Catalog window to run it.
I have tried it on several different folders; it works in 10.3, not in 10.6. The folders are on the same network drive as the toolbox.
I'll try a couple of things tomorrow:
1) run it on a local folder rather than a network folder
2) run it from model builder
I would appreciate hearing any other ideas to try.
When I mean run is run it from arctoolbox inside arcmap...not arccatalog. It appears you might just be running arccatalog and not arcmap. Open arctoolbox inside arcmap and try the tool there.
Glad you tried the local folder and run from model builder.
I can't find anything on the Support site.
You skipped so many versions that this may be a strange combination, so I would be prepared to ship stuff off to Tech Support for confirmation and testing.
I've been running it in ArcMap. I will try running it from ArcCatalog. If I haven't found a solution, I'll be contacting Tech Support later today when their day has started.
Even though we haven't come up with any solution, I appreciate your help!
I found that running it in the model builder window in 10.6 worked (running from anywhere else in 10.6 did not). I saved it in 10.6 but then model disappeared from the catalog on my 10.3 machine. So retrieved an archived copy of the tool that worked on 10.3, saved it on the 10.6 machine with a different name and now it works in 10.6
I'm guessing that model builder models are not backwards compatible so that's why it disappeared in the 10.3 catalog.
Oops, I guess I was too hasty! In the process of getting a toolbox that works in 10.3, I deleted what I thought worked in 10.6. I went through what I thought was the same process that I used when I thought it worked -- copy the archived copy to my network drive location, open and run the tool in model builder, delete the parameter data and save--but it doesn't work. It still works in model builder, so I'm guessing I must have run it from model builder when I thought I had run it from the catalog.
Back to the drawing board. Time to contact tech support.
could you export the model to a python script... perhaps someone could cobble together a script tool that will work so you can abandon the model and get something that can be used in both versions of arcmap