Select to view content in your preferred language

Using Input names with iteration number

788
7
06-24-2010 06:31 PM
HolmSeifert
Emerging Contributor
Hi everybody,

i have a question about using input names in modelbuilder.
Does anyone knows a clue how to integrate input names in the output Class?
I have some input raster´s with different input names. Every raster is proccessed thorugh several tools. In the end I want for every output raster its input name plus the iteration index n.
Example:
Input raster: Test
--> several processes
Output raster: Test0

Thanks
0 Kudos
7 Replies
KevinHibma
Esri Regular Contributor
I'd have to see your model to be able to give you the exact syntax, but the basic idea is every "circle" part of ModelBuilder (the input/outputs) can be referenced via the name you set.

So, lets say you have copy features and it looks like this in the ModelBuilder window:

InputFeatures -- Copy Features -- OutputFeatures

If you are iterating over a bunch of FeatureClasses you already know about the "n".
So you can set the output to: %InputFeatures%_%n%
Which should give you something like:
roads -> roads_1
lakes -> lakes_2
rivers -> rivers_3

This help topic does a good job of explaining inline variables:
http://webhelp.esri.com/arcgisdesktop/9.3/body.cfm?tocVisable=1&ID=857&TopicName=In-line%20variable%...
0 Kudos
HolmSeifert
Emerging Contributor
Hallo Kevin,

thanks. For Featgures it works.
But I want to use this for Rasters. I have tried the sequence exactly like the copy sequence, but everytime this failure occur:
"A locator with this name does not exist."
I just create a simple process.

Copy Raster -- %Input Raster%_%n%

For the Input Raster i have choosen 2 Raster Datasets stored in a gdb.
Can you help me?

thanks
0 Kudos
KevinHibma
Esri Regular Contributor
Could you post your model or the picture of your model?
0 Kudos
HolmSeifert
Emerging Contributor
Hi Kevin,

here some data, a gdb, jpeg of the model and the failure message.
Hope you can find a solution.

thanks
Holm
0 Kudos
HolmSeifert
Emerging Contributor
here is the model

regards

Holm
0 Kudos
KevinHibma
Esri Regular Contributor
Holm,

Thanks for providing that - it clears up my understanding of the question.
The information I originally providing you with wont work in this situation. Unfortunately the LIST doesn't provide the %n%. Additionally you can't control the output name with the input name via the inline variable with a list in the manner I proposed. (my apologies, I'm confusing functionality between 931 and 10).
The %n% count is only available with SERIES and with the Iterators built into ArcGIS 10.

It may only be possible to accomplish this with a script. I'll have to look into it a little more.
0 Kudos
HolmSeifert
Emerging Contributor
Hi Kevin

thanks a lot. I guess now its time to learnin g python. 😉
At the momemt i´m learning it.
Next time i going to create a python script which allows to import different data.
I guess the command woulkd be something about the cursor command.
Hoppefully i will create the script till tomorrow.

(But there is fifa soccer :D)

thanks and regards
Holm
0 Kudos