导成dbf,在excel中编号再导入,可以实现,导去导来觉得麻烦,故使用Python语句来实现
方法一:
1、先根据设定的字段排序
需要利用排序工具
2、字段计算器填入语句
语句:
star= 0 cm='' def num(layer): global star global cm if cm==layer: star+=1 else: star=1 cm=layer return star
填入:(str(num(!Layer!))).zfill(2)
方法二:
想想也试了下Python窗口,用语句操作,感觉更快
import arcpy rows=arcpy.UpdateCursor("出图图框ok","","","Layer;BB","Layer A;Y D;X A") i=1 cm="" for row in rows: if row.Layer==cm: i=i+1 else: i=1 cm=row.Layer row.BB=i rows.updateRow(row) del row del rows
标签:语句,Layer,rows,star,cm,流水号,ArcGIS,字段,row From: https://www.cnblogs.com/jiongya99/p/17187913.html