When run from the Python Window, layer.getSelectedExtent() crashes ArcMap.
Last Published: August 25, 2014No Product Found
Bug ID Number
NIM084055
Submitted
August 22, 2012
Last Modified
April 2, 2025
Applies to
No Product Found
Version found
10.1
Status
Duplicate
The issue is a duplicate of an existing issue. See the issue's Additional Information section for details. Customers associated with the duplicate issue are automatically attached to the open issue.
Additional Information
NIM084005
Workaround
Instead of using the layer object to gather the extent, use the data frame properties by first zooming to the selected features then reading the extent of the data frame. For example:>>> map = arcpy.mapping.MapDocument("current")>>> df = arcpy.mapping.ListDataFrames(map)[0]>>> df.zoomToSelectedFeatures()>>> extent = df.extent>>> print extent