Question about creating a variable from an expression parameter in Model Builder

650
2
03-22-2012 06:45 AM
SummerChandler
New Contributor
I am trying to create a simple model to automate a repetitive task for exporting some points as a shapefile.   Essentially, the idea is to select several route segments based on an attribute containing the name of the route using the Select Layer by Attribute tool, then to select points within a certain distance of the previously selected routes and export them as a shapefile.  I have it working when I plug in some example data, but I am finding it harder than I expected to prompt the user to input the name of the route to start the initial selection.  The query I am using is:

Line_Name = 'Route Name'

I am hoping to set it up so that the users only have to enter 'Route Name' without having to choose the Line_Name field first. 

Can this be done in Model Builder?  Would Python be a better choice?
0 Kudos
2 Replies
KevinHibma
Esri Regular Contributor
For sure this can be done with inline variables.

High level help:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002w0000001t000000
Inline vars in Modelbuilder:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Examples_of_inline_model_variable_subs...

Example 3 from the above topic pretty much does exactly what you want.
Create a variable, then use the inline variable in your select statement.
0 Kudos
SummerChandler
New Contributor
Exactly what I needed.  Thank you!
0 Kudos