AnsweredAssumed Answered

current extent in geographic coordinates using python

Question asked by NewGuard on Nov 19, 2012
Latest reply on Nov 20, 2012 by NewGuard
Here is my problem:  I have been using the maptokml tool extensively.  My map documents are not in geographic coordinates, nor are the other users map documents that I support.  When I use the maptokml tool, I am constantly having to MANUALLY change the display coordinates to decimal degrees and manually enter them in the extent box every time I want to export the current view and then change the data frame display coordinates back.  This is terribly annoying, time consuming, and error-prone.  I would like a simple method or routine to get the geographic coordinates of the current map view so that I can run them through the maptokml tool in a script to automate this process. 

For the record, I wasted the better part of a day writing a script to get the current view extent, create a polygon, put it into a temp feature class, reproject that feature class, create a cursor, read the extent of the polygon feature (or read the extent of the feature class) and then plug those into the maptokml tool.  It was painful, full of errors (a lot of errors from bad syntax in ESRI help), frustrating, and is still not working correctly.  It never reprojected the coordinates for the polygon despite creating a new spatial reference and creating the polygon with that reference.  I'm just burned out.....anybody have a working tool or suggestion that I might run with?  Should I just try to change the current dataframe projection?  Reproject a polygon/feature class and then query the extent?  Read the display coordinates (if that is possible)??  HHHEEELLPPPPP!!!!

Thanks in advance....