# Define Map (mxd) Document Location. mxd = arcpy.mapping.MapDocument("MapLocation") # Define Map Data Frame. df = arcpy.mapping.ListDataFrames(mxd, "NameOfDataframe")[0] # Select County Layer, Zoom to Layer. arcpy.SelectLayerByAttribute_management("CountyLayer","NEW_SELECTION") df.zoomToSelectedFeatures() # Define scale of dataframe to match the county layer you zoomed to. df.scale = df.scale # If that did not work this should. scale = df.scale df.scale = scale # This will set the Reference Scale to match the df.scale, if you want. df.referenceScale = df.scale # Clear the Selection, So its not blue on the pdf export. arcpy.SelectLayerByAttribute_management("CountyLayer","CLEAR_SELECTION") # Refresh the Active View. arcpy.RefreshActiveView
How are you inputting your xMin, yMin, etc. values into your script? Are they manually entered or automatic from your layer? What specifically are you trying to isolate as your extent?Also.http://forums.arcgis.com/threads/48475-Please-read-How-to-post-Python-code
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.