AnsweredAssumed Answered

Model Builder - Using String Variables Throughout Model

Question asked by sagunn on Jun 4, 2012
Latest reply on Jun 5, 2012 by sagunn
Hi all,

ArcMap 10 SP3, Python 2.6.5

Hoping you can shed some light on this problem for me...I have constructed a model that starts out with 5 string variables that are all model parameters based on user input.  I have successfully used these variables in the "Select
Layer by Attribute" tool.  However, I have a script that runs at the very end of the model process to set some custom map layout settings (zoom to selection for example).  I have tried to call these user input variables to set the map title in this final script but ArcGIS keeps telling me that these variables are not defined.  The exact error is: <type 'exceptions.NameError'>: name 'Section' is not defined.

Does anyone know how to "reuse" these user input variables at a later point in the model process?  I have tried setting a precondition on the script to wait for the selection process, but that did not help.

Attached is a screenshot of my model and script to set title.  Any insight would be appreciated.  Thank you!

[ATTACH=CONFIG]14939[/ATTACH]


import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") mxd.title = Section arcpy.RefreshActiveView

Note above: I have also tried %Section% to no avail.

Attachments

Outcomes