import arcpy
fc = r"C:\Users\songwk.songwk-PC2.000\Documents\ArcGIS\Default.gdb\GX_DSL_Intersect"
with arcpy.da.UpdateCursor(fc, ["SHAPE@","SX","SY","EX","EY"]) as cursor:
for row in cursor:
#print("QD:X = {0},Y = {1}",row[0].firstPoint.X,row[0].firstPoint.Y)
#print("ZD:X = {0},Y = {1}",row[0].lastPoint.X,row[0].lastPoint.Y)
row.setValue("SX",row[0].firstPoint.Y)
row.setValue("SY",row[0].firstPoint.Y)
row.setValue("EX",row[0].lastPoint.X)
row.setValue("EY",row[0].lastPoint.Y)
cursor.updateRow(row)
del cursor, row
1 个回复
turtle
赞同来自:
具体的差别查看帮助文档
代码改成下面就可以
要回复问题请先登录或注册