Selecting related tables in ModelBuilder or Python

4268
1
09-24-2012 01:50 PM
StephenRhone
New Contributor III
If I have a feature class and a table in a geodatabase, and there is a relate between them, I can very easily select a bunch of features in the feature layer in ArcMap and use the Related Tables pulldown in the table attribute window to select only those features in the table that relate to the selected features in the feature class.  That's basic GIS 101, right? 

What I am having trouble finding is a way to do the same thing, but using ArcToolbox/ModelBuilder or Python instead, so that I could include such queries in scheduled tasks.  I have searched the help documentation and looked up in the various forums, but haven't found anything promising.  Has anyone any suggestions?  Thanks.

Stephen
1 Reply
PeterWilson
Regular Contributor
Hi Stephan

You are going to have to use a ModelBuilder tool called "Calculate Value" and write an ArcPy expression using a Search Cursor:

Calculate Value
Search Cursor

Hope this gets you going :)

Regards
0 Kudos