Sunday, 24 December 2017

arcmap - Zooming to selection in arcpy.mapping and only seeing selected features?


I selected data by using select layer by attribute, then I need to only select these selection and zoom in to the selection. my code is this, it can zoom in base on the scale I set, but I see other adjacent polygon that has other Code_No, why?


Layer = arcpy.mapping.ListLayers(mxd, "lyr", df)       
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", "Code_NO = '%s'"%mycodeNo)
df.extent = lyrLayer1.getSelectedExtent()
df.scale *= 2


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...