I am writing a python script for ArcGIS. I have an input feature class which contains multiple pipelines which is saved as a variable InputPipeline
. I would like to iterate through the pipelines and run some run some processes on them individually.
The script is set up to prompt the user to choose the field which contains a unique identifier for each pipeline. I am saving this field as a variable called PipelineIDField
.
I run a search cursor to get the actual pipe name in that field and I'm saving that as fullRouteName
.
I'm using:
arcpy.MakeFeatureLayer_management(InputPipeline, 'SelectedPipe', where_clause)
and the where clause is defined as:
where_clause=""""%s" =""" %PipelineIDField + """ '%s' """ %fullRouteName
I would assume that I could then successfully use 'SelectedPipe' to run my processes on the individual pipe.
This is successfully working when I run the where clause in the python window within ArcGIS, however, it doesn't select out the individual pipes in my script. The where clauses are identical.
I have tried using escape characters "\"" and "\'" with the same result.
Any idea what is going on here?
I'm using ArcGIS 10.1 service pack 1 on Windows 7 64-bit.
Thanks.