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

03-22-2012 06:45 AM
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
Esri Regular Contributor
For sure this can be done with inline variables.

High level help:
Inline vars in Modelbuilder:

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
New Contributor
Exactly what I needed.  Thank you!
0 Kudos