Select to view content in your preferred language

list the attributes of a field  and then make a selection for each Python

3891
5
10-27-2014 09:28 AM
GustavoCordero
New Contributor III

I'm using 10.2.2 Argis and I'm doing a model modelbuilder

 

 

I want to know how I can list the attributes of a field

and then make a selection for each Python

 

 

I have shp with the field called "name" example

 

 

name |

-----------

BB

BB

AB

AB

C

C

 

 

list BB, AB, C

 

 

I want to list to make a selection for each of it

"name" = 'BB'

 

 

 

 

could help me and say how could I make this script

0 Kudos
5 Replies
StevenGraf1
Regular Contributor

Add in the Select by Attributes Model.  This will let you make the Query Builder a parameter which when you select a field, click Get Unique Values and it will list all the values for that field.  You don't need to use python.

Steven

GustavoCordero
New Contributor III

the problem is that it can be hard same field name but different attributes

0 Kudos
GustavoCordero
New Contributor III

example, the input can be Shp_1 with "name" attribute name field

AA

AA

BB

CC

Shp_2 with "name" attribute name field

Now with attributes

BZ

BV

BV

0 Kudos
DanPatterson_Retired
MVP Emeritus

What do you want to do with it after?  It would help guide further suggestions.

0 Kudos
GustavoCordero
New Contributor III

ok

I have a point layer with the "name" field

eg all the "name" AA belong to a geographical area espesifica

name |

AA

BB

CC

I want to make the selection of all AA and then use the tool "Make OD Cost Matrix Layer" of network analys

  detminiar to distance and cost between points AA

then do the same with BB, CC etc

now the problem is that the input files will not always "name" AA, BB, CC could change these

0 Kudos