Model Builder Tool that...

705
11
Jump to solution
07-15-2013 07:39 AM
ShikoNjuno
Occasional Contributor
Hello folks, I'm trying to find a tool on model builder that checks a list of user input values against an existing shapefile. Then, if it does exists, data from the corresponding raster files  will be extracted.
I realize this may require two or more different tools but if anyone can suggest at least one that checks existence of data, that'll be really helpful to get me started.
Thanks.

Shiko
0 Kudos
1 Solution

Accepted Solutions
ShitijMehta
Esri Regular Contributor
Ok.

Try this:

Read this blog If you are stuck at if Part 4
Download the script tool from the link in the blog.
Then try to create a model as shown in the attachment.

View solution in original post

0 Kudos
11 Replies
ShitijMehta
Esri Regular Contributor
Hi,
Check the example 3 from this blog "If you are stuck at if - Part 1" to get some idea.
ShikoNjuno
Occasional Contributor
Thank you Shitij....this is definitely helpful. :)
0 Kudos
ShikoNjuno
Occasional Contributor
Hi,
Check the example 3 from this blog "If you are stuck at if - Part 1" to get some idea.


Alright so I tried out the scrip but the output keeps returning false even when i know it's true. What I think is happening is that the script provided in the example above is for a FeatureClass whereas, I'm trying to check within a specific attribute field in the featureclass.
Do you know of any script that can help me specify which attribute field to check within the featureclass. Also, the Workspace in the example I'm assuming is the entire geodatabase folder, but my workspace would have to be just the one file/featureclass correct?
Maybe I have it all wrong but I'd appreciate any comments or suggestions.
Thanks
0 Kudos
ShitijMehta
Esri Regular Contributor
Hi
You want to check if a particular field exists in a feature class or not: if this is correct: check the attached example of how to use the Calculate Value tool and the python code. Hope this helps. Let me know.
0 Kudos
ShikoNjuno
Occasional Contributor
Not exactly.....
What I want is to check if a list of user-input string values exists in one of the attribute fields within the shapefile.
Below is sample code that someone gave me to achieve this but it's still not quite what I need.
See the thread:

http://forums.arcgis.com/threads/88566-Python-Code-Assist!!!

I really appreciate your assistance.
Thanks.
0 Kudos
ShitijMehta
Esri Regular Contributor
ok. Lets try again.

So you have some string values provided by the user say : Babbler, Sparrow and Crow. You want to check if any or all? Babbler, Sparrow and Crow values exists in a field called birds in your input feature class. Is this correct?

How do users provide these values. A separate variable for each user input, meaning a variable for Babbler, another separate variable for Sparrow and so on? or the user provides these values in a single multivalue variable?


You want to check if a particular value exists in a field????
0 Kudos
ShikoNjuno
Occasional Contributor
Exactly :)....the user will input tax lot numbers into a list which is defined as a list of type String, which may or may not be the right setting to have?!!
But yes....that is exactly what I'm trying to do....at least to begin with.
0 Kudos
ShitijMehta
Esri Regular Contributor
Ok.

Try this:

Read this blog If you are stuck at if Part 4
Download the script tool from the link in the blog.
Then try to create a model as shown in the attachment.
0 Kudos
ShikoNjuno
Occasional Contributor
Excellent!!!
I know what I'll be working on this afternoon :D
Great help.Thanks for your time.
0 Kudos