I am trying to use the search cursor to read through a point shapefile's (road drainage pipes) attribute table and, when a condition is met (row[0] == 'yes'), select a separate line feature (roads) based on an attribute of the point feature (each road drainage pipe point has an attribute for the road it is on) to force the arcpy.edit.snap tool to snap that point to the nearest spot on the edge of that specific line (road). The script runs but all points (not just the ones meeting the condition) are snapped to the nearest spot on nearest line (not the specified line). Here is that part of my code so far. Any help would be appreciated.
RMapPts = outPutPath + '/Form_1.shp'
query = """'{0}' = '{1}'""".format(arcpy.AddFieldDelimiters(Roads, 'ROAD_MAP_LABEL'),
arcpy.AddFieldDelimiters(RMapPts, "WhatRoad"))
cursor = arcpy.da.SearchCursor(RMapPts, 'NewSite')
for row in cursor:
if row[0] == "yes":
arcpy.SelectLayerByAttribute_management(Roads, 'NEW_SELECTION', query)
arcpy.edit.Snap(RMapPts, [[Roads, "EDGE", "500 Feet"]])