Select to view content in your preferred language

Using extents in python

360
1
08-21-2012 07:16 AM
ChadFoster
Deactivated User
I had a python script in ArcGIS 10, Python 2.6 that would get the extent of selected features and then zoom out from that exent.

In ArcGIS 10.1, Python 2.7 my script crashes at that point. 

arcpy.SelectLayerByAttribute_management(layer1, "NEW_SELECTION")
df.extent = layer1.getSelectedExtent(True)
arcpy.SelectLayerByAttribute_management(layer1,"CLEAR_SELECTION")
df.scale = df.scale * 1.4


Any help or suggestions would be greatly appreciated

Thanks,

Chad
Tags (2)
0 Kudos
1 Reply
ChadFoster
Deactivated User
I am also experiencing "locking" issues with this script at 10.1.

I wrote this script for 10.0 and am using a FGDB to store temporary files for the MXD.

I have turned on the overwrite outputs for geoproccessing, but still get errors saying that these layers are locked.
0 Kudos