Create a polygon from data frame

4459
6
07-02-2016 02:05 AM
Highlighted
Occasional Contributor II

I am hoping there is a simple way to create a polygon (feature class or shapefile) from the extent of the data frame in layout mode.

I know it is possible to view the bounding coordinates for the data frame and plot a polygon that way, however this is quite a laborious task which can be automated.

I discovered this tool http://www.arcgis.com/home/item.html?id=0dcb445291bf461bb573b1504c170e0c

however when I install the Add-in I'm unable to see any new extensions or toolbars added. I am using version 10.2.2

Reply
0 Kudos
6 Replies
Highlighted
MVP Esteemed Contributor

I am not at a place to test this, but here are a few things to check or try when installing this or any addin.

  • Make sure it is in the correct software ArcMap v's ArcCatalog.  Typically they are built for one or the other, not both. I'm assuming that one is for Map and since it says 10.0 and above, it should work
  • Check the addin manager under...I think....tools extensions. 
  • Make sure the toolbar is turned on.
  • i found another way to add addins is to use the "customize"  (for adding toolbars etc.) selecting "add from file" at the bottom, and to point to the .addin file.  TIP: for those writing their own and updating->creating->testing, using this method prevent having to close/re-open the software for a refresh.
  • .addin files are just .zip files with a different extension.  Change .addin to .zip, unzip the file, and you should be able to access the toolbox and run it manually.  This is assuming there isn't some type of encryption, but typically the addin is just an easy way to package tools and toolbars wi all the dependencies.  So give that a try.

hope that helps.

Highlighted
Occasional Contributor II

Thank you, I was eventually able to figure out where I was going wrong.  I ensured the tool was installing to:

C:\Users\<username>\Documents\ArcGIS\AddIns\Desktop10.2.

Turns out the tool was installing correctly, however I was looking for a new toolbar, and not an actual tool/command. Unfortunately there were no instructions telling me what to look for, however I found it here.

Tool.jpg

Only problem now is the tool crashes ArcMap whenever I click the button!

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

Hard to say what is causing the crash, but it's always good to try Resetting your ArcGIS application profile​  or log in as a different user to see if there is something that is flaky with your account.  That will at least eliminate those possible issues.

Reply
0 Kudos
Highlighted
Occasional Contributor

Use the Create Data Frame Polygon Tool.(Add-In).. Maybe turn off the Geo Referencing Tools if you have it open? Tool many tools maybe the problem and that tool causes some problems with memory cache.

Reply
0 Kudos
Highlighted
Occasional Contributor II

This one works for me http://www.arcgis.com/home/item.html?id=a9b032f739254ebeb6221c9294ebc886

There's a version for 10.2 but I don't have a link for it.

Cheers!

Mike

Highlighted
MVP Honored Contributor

This is about the bare minimum required to make it happen via Python:

>>> mxd = arcpy.mapping.MapDocument("CURRENT") # map

... df = arcpy.mapping.ListDataFrames(mxd)[0] # get 1st data frame

... sr = df.spatialReference # get spatial reference

... ext = df.extent # extent object

... BL = arcpy.Point(ext.XMin,ext.YMin) # bottom left

... BR = arcpy.Point(ext.XMax,ext.YMin) # bottom right

... TR = arcpy.Point(ext.XMax,ext.YMax) # top right

... TL = arcpy.Point(ext.XMin,ext.YMax) # top left

... df_poly = arcpy.Polygon(arcpy.Array([[BL,BR,TR,TL,BL]]),sr) # create polygon

... arcpy.CopyFeatures_management(df_poly,r'in_memory\poly') # write to disk