arcpy限制返回地图元素

import arcpy.mapping as mapping
mxd = mapping.MapDocument(“CURRENT”)

#仅仅返回图例
for el in mapping.ListLayoutElements(mxd,”LEGEND_ELEMENT”,”*Crime*”):
    print el.name
#更改布局元素的属性

import arcpy.mapping as mapping
mxd = mapping.MapDocument(“CURRENT”)
elLeg = mapping.ListLayoutElements(mxd, “LEGEND_ELEMENT”,”*Crime*”)[0]
elLeg.title = “Crimes by School District”
for item in elLeg.listLegendItemLayers():
    print item.name
#获取可用的打印机列表

import arcpy.mapping as mapping
mxd = mapping.MapDocument(“CURRENT”)
for printerName in mapping.ListPrinterNames():
    print printerName
 

转载自:https://blog.csdn.net/A873054267/article/details/85871790

You may also like...