1

I am working on building a model that uses this tool to convert Points into GPX files for use in my GPS units.

I've built a simple model that seems to work, except that the final output is constantly overwriting with the same instead of iterating to the next Name entry.

The model looks like this

enter image description here

Geodatabase holding file is a parameter that lets me select the GDB with all the various point layers. Name of File is basically R:\FilePath\GPX\%Name%_GPX.gpx

When I run the model, it will iterate down the line of files inside the GDB, but they all just get the name of one of the files.

The results window looks like this, repeated.

Executing (Features to GPX): FeaturesToGPX "R:\FilePath\2016ST_AllPoints.gdb\ST2016IA131" R:\FilePath\GPX\test1\ST2016IA201_GPX.gpx # # Start Time: Tue Oct 25 10:35:20 2016 Running script FeaturesToGPX... Completed script FeaturesToGPX... Succeeded at Tue Oct 25 10:35:21 2016 (Elapsed Time: 0.76 seconds) Executing (Iterate Feature Classes): IterateFeatureClasses "R:\FilePath\2016ST_AllPoints.gdb" # POINT NOT_RECURSIVE Start Time: Tue Oct 25 10:35:21 2016 Succeeded at Tue Oct 25 10:35:21 2016 (Elapsed Time: 0.27 seconds) Executing (Features to GPX): FeaturesToGPX "R:\FilePath\2016ST_AllPoints.gdb\ST2016IA156" R:\FilePath\GPX\test1\ST2016IA201_GPX.gpx # # Start Time: Tue Oct 25 10:35:21 2016

Anyone have an idea why my model is overwriting and not moving on?

1
  • Use %name%.shp to retain name in output as input file name. Commented Aug 28, 2018 at 7:43

2 Answers 2

2

There are several ways to deal with naming in model builder. ArcGIS has a help section on this: A quick tour of using inline variable substitution.

Based on your issue, this example seems to best suit your needs.

enter image description here

Alternatively you could call the %i% or %n% system variables, which output files in the following form: file1, file2, file3, file4... The %i% system variable references the current list position, while the %n% system variable references the current model iteration.

1
  • I actually tried %n% before, which still had the same issue, except instead of the iterator replacing the name, it just constantly replaced it with the number 0. I actually need it to take the original name from the file, since its how my company sorts these things, so %n% won't work for me. It is pulling the actual names properly, but for some reason the iteration process doesn't start over, it just replaces.
    – Sekh
    Commented Oct 25, 2016 at 16:26
0

You need to add something to the file name like %n%_pt. This will take all the files and name them the input_pt. And you will have all new outputs, no overwriting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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