## set extent newExtent = df.extent newExtent.XMin = extent[0] newExtent.YMin = extent[1] newExtent.XMax = extent[2] newExtent.YMax = extent[3] df.extent = newExtent
##set extent newExtent = df.extent newExtent.XMin = extent[0] newExtent.YMin = extent[1] newExtent.XMax = extent[2] newExtent.YMax = extent[3] df.extent = newExtent ##set extent (AGAIN) newExtent = df.extent newExtent.XMin = extent[0] newExtent.YMin = extent[1] newExtent.XMax = extent[2] newExtent.YMax = extent[3] df.extent = newExtent
## set extent newExtent = df.extent newExtent.XMin = extent[0] newExtent.YMin = extent[1] newExtent.XMax = extent[2] newExtent.YMax = extent[3] df.extent = newExtent del newExtent ## set extent a second time - v10 bug workaround df2 = arcpy.mapping.ListDataFrames(mxd, "MAIN_MAP")[0] anotherExtent = df2.extent anotherExtent.XMin = extent[0] anotherExtent.YMin = extent[1] anotherExtent.XMax = extent[2] anotherExtent.YMax = extent[3] df2.extent = anotherExtent del anotherExtent ## set rotation and scale df.rotation = rotation df.scale = scale
Would just like to point out that this error still exists in arcgis 10.2
A work around I used is to set the extent, and save a temporary image file. Then delete the image file and set the extent again (using the same extent object). The extents of the dataframe will have changed.
It seems it is not particularly the data frame not 'capturing' the extents properly, but the extents themselves being wrong?
Also, simply setting the extents twice didnt work for me. I have to save the image inbetween. Could be an indicator of references hanging round/caches not being cleared or similar?