python代码实现arcgis标注某要素的某字段

python代码实现arcgis标注某要素的某字段,第1张

困扰我好几天的属性字段标注用python代码表示今天终于解决了,和大家分享一下下!!!!

mxd=arcpy.mapping.MapDocument("current")
for lyr in arcpy.mapping.ListLayers(mxd):
    if lyr.name == "要素图层名称":
        lyr.showLabels = True
        for lblClass in lyr.labelClasses:
            lblClass.showClassLabels = True
            lblClass.expression = "[字段名称]"

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/918205.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-16
下一篇2022-05-16

发表评论

登录后才能评论

评论列表(0条)

    保存