iterate multivalue - is there a way to enter a block of text?

1108
1
Jump to solution
03-20-2011 11:49 AM
ThomasDilts
Occasional Contributor III
Hi,

I'm working on a model that uses co-kriging to create hundreds of precipitation layers (see model.png).  The model works except that I need to enter in each value manually for the iterate multivalue tool.  Since I've got hundreds maybe thousands of values it'll take me hours if not days just to enter the values.  I'd like to get this automated so that I can enter a block of text seperated by delimiters.  I see two possible approaches:

1.  Is it somehow possible to alter the iterate by multivalues tool to get it to accept a block of values seperated by delimiters (see dialog.png)?

2.  Alternatively does anybody know the python version of iterating by multivalues since modelbuilder doesn't allow us to export scripts that involve iteration?

Thanks.  I look forward to hearing your ideas.
0 Kudos
1 Solution

Accepted Solutions
ThomasDilts
Occasional Contributor III
I managed to find a thread on StackOverflow that solved my problem http://stackoverflow.com/questions/3904389/adding-multiple-field-names-in-arcgis-using-python.

The solution using python was to replace infields = arcpy.GetParameterAsText(1)
with infields = arcpy.GetParameterAsText(1).split(',')

then add the following
for i in range(len(infields)):

Then the entire script is embedded within the for loop.
The len() function finds the length of the list.

-Tom Dilts

View solution in original post

0 Kudos
1 Reply
ThomasDilts
Occasional Contributor III
I managed to find a thread on StackOverflow that solved my problem http://stackoverflow.com/questions/3904389/adding-multiple-field-names-in-arcgis-using-python.

The solution using python was to replace infields = arcpy.GetParameterAsText(1)
with infields = arcpy.GetParameterAsText(1).split(',')

then add the following
for i in range(len(infields)):

Then the entire script is embedded within the for loop.
The len() function finds the length of the list.

-Tom Dilts
0 Kudos