I have a map document with about 10 layers that I would like to create a query definition script tool to use that takes a user input as a parameter and then executes the tool. The script looks like this:
import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers") field = 'Circuit' #INPUT CIRCUIT USING THIS FORMAT: 'DC430' value = queryStr = str(field) + "=" + str(value) for lyr in arcpy.mapping.ListLayers(mxd, "", df): if lyr.supports("DEFINITIONQUERY"): lyr.definitionQuery = queryStr arcpy.RefreshActiveView() del mxd
I can't figure out how to configure the script tool to use the value variable as a user input that then gets used in the definition query. Is this possible?