Hello,
try to select by attributes a feature class, but it doesn't work?
Any ideas why?
fields = ["OBJECTID", "TARGET_FID"]
with arcpy.da.SearchCursor(outMerge, fields) as cursor:
for row in cursor:
if row[1] > 0:
selClause = str(row[1])
selClause1 = "OBJECTID = {0} Or TARGET_FID = {0}".format(selClause)
print (selClause1)
arcpy.management.SelectLayerByAttribute(outMerge, "NEW_SELECTION", selClause1)
result = arcpy.management.GetCount(outMerge)
print (result[0])
if int(result[0]) > 1:
outIntersLines = "outIntersLines_{}".format(row[0])
# arcpy.management.PointsToLine(outMerge, outIntersLines)
else:
continue
else:
continue
The print statements line 9 looks ok for me:
OBJECTID = 1 Or TARGET_FID = 1
But there's nothing selected?