5

Is there an easy way to create a polygon that matches the data frame in my page layout?

I'm trying to set up data driven pages and want to have it key off of polygons that frame the boundaries for each page. I would like to see them as polygons so that I can re-position as necessary and quickly visualize what will appear on each page.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Aug 13, 2012 at 15:22

2 Answers 2

7

I was wondering about the same but found that there is no such out-of-the-box tool.

I made an add-on for this. You can download it here: http://www.arcgis.com/home/item.html?id=a9b032f739254ebeb6221c9294ebc886

answered Aug 13, 2012 at 15:35
0
2

From the ArcGIS online help under the "Data Frame" class, DataFrame example 4 shows you how to do this:

The following script converts a data frame's extent object into a polygon feature so that it can be used with the SelectLayerByLocation_management function.

import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Transportation")[0]
lyr = arcpy.mapping.ListLayers(mxd, "Accidents", df)[0]
#The DataFrame extent object is converted into a polygon feature so it can be used with the SelectLayerByLocation function.
dfAsFeature = arcpy.Polygon(arcpy.Array([df.extent.lowerLeft, df.extent.lowerRight, df.extent.upperRight, df.extent.upperLeft]),
 df.spatialReference)
arcpy.SelectLayerByLocation_management(lyr, "INTERSECT", dfAsFeature, "", "NEW_SELECTION")
mxd.save()
del mxd
PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
answered Oct 28, 2013 at 23:26

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.