Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. mxd = arcpy.mapping.MapDocument("CURRENT")
  2. lr=arcpy.mapping.ListLayers(mxd)[0]
  3. tbl=arcpy.da.TableToNumPyArray(lr,("oid","A","B"))
  4. bs=sorted(tbl, key=lambda x: (x[1], x[2]))
  5. aDict={}
  6. for i,row in enumerate(bs):
  7. aDict[row[0]]=i
  8. def sortSeq(fid):
  9. return aDict[fid]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement