Using Layer Name reference in Model Builder

3548
1
05-25-2011 02:30 PM
JeffBruck
New Contributor
In model builder, how does one reference a layer name for a field name parameter in a field calculator process based on a user selected layer?


I am creating a tool in model builder where the user selects a layer, and then the tool performs various tasks on the layer. For example, a user selects Layer X and Layer X is immediatly used for process A, then process B, C etc. My question is how do I reference the user selected layer name in in the field name parameter used by the field calculator tool?

for example..a model is run, the user selects a layer named "Roads" then process A then occurs in the model followed by process B which is a field calculation on the streetname attribute of the "Roads" Layer. How do I feed the user selected layername (in this case "Roads") to the "field name" parameter of the field calculator tool?

(FYI.. The layer name is roads in this example, but it could be roadline, roadsmajor etc next time)
0 Kudos
1 Reply
JeffBruck
New Contributor
I ended up figuring this one out with some help from the ArcGIS Desktop help documentation, and an esri blog post.

To utilize the name of a layer, table, user input etc in a model for one or more processes, one needs ot utilize "in line variable substitution". (see link below)

http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=In-line_variable_substitution


FYI.. a wealth of knowledge on important model builder concepts like this can be found in a esri blog post titled "What I wish I had known about Model Builder before I started using it" 
http://blogs.esri.com/support/blogs/mappingcenter/archive/2009/02/19/10-things-i-wish-i-had-known-ab...
0 Kudos