使用Python修改table of content下的图层名称

使用Python修改table of content下的图层名称
已邀请:

张国丽

赞同来自:

【解决办法】:
将TOC中的图层名为point的,修改为point1,运行前将mxd文档关闭,使用editor with IDLE运行,具体代码参见:
import arcpy
mxd = arcpy.mapping.MapDocument(rE:\ZGL_zuoxi\idw_2\idw.mxd)
for lyr in arcpy.mapping.ListLayers(mxd):
     if lyr.name == point:
         lyr.name = point1
mxd.save()
del mxd

要回复问题请先登录注册