首页 > 编程语言 > 详细

arcgis python RefreshActiveView CLEAR_SELECTION

时间:2019-05-28 00:10:34      阅读:291      评论:0      收藏:0      [点我收藏+]
import arcpy

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
lyr = arcpy.mapping.ListLayers(mxd, "Cities", df)[0]

# Use the SelectLayerByAttribute tool to select New York and 
#  zoom to the selection
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", 
                                        "CITY_NAME = ‘New York‘")
df.zoomToSelectedFeatures()

# Export the map to a .jpg
arcpy.mapping.ExportToJPEG(mxd, "C:/data/NewYork.jpg")

# Clear the selection and refresh the active view
arcpy.SelectLayerByAttribute_management(lyr, "CLEAR_SELECTION")
arcpy.RefreshActiveView()

del mxd

 

arcgis python RefreshActiveView CLEAR_SELECTION

原文:https://www.cnblogs.com/gisoracle/p/10934301.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!