AnsweredAssumed Answered

Expression for select by attribute

Question asked by ncelik on Apr 28, 2015
Latest reply on Apr 29, 2015 by ncelik

Hello, I have unique list  like ProcessedData=["Line1","Line17","Line76"....] and I have a point data in which every point has the line name they belong to in its attribute table. I want to select those points based on their line names but only the ones in that unique list. I am applying the python code below but processing is very slow. I need to select 10000 lines and the process is very slow with the code below. Is there any other way of writing the expression so that it selects them in same time instead of one by one in a for loop ?


for item in ProcessedData:

     Expression= "\"LineName\" = "+ "'"+item+"'" 

     arcpy.SelectLayerByAttribute_management ("PointData", "ADD_TO_SELECTION", Expression)