<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic get current Map extent with correct mapUnits in ArcGIS Pro using arcpy? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/get-current-map-extent-with-correct-mapunits-in/m-p/1266833#M67055</link>
    <description>&lt;P&gt;How can I get the current maps extent with configured mapUnits?&lt;/P&gt;&lt;P&gt;Two examples always return the unit of the map projection (Meters) instead of the configured mapUnits (degrees).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;av = aprx.listMaps('Map')[0]
print(av.name)
av.mapUnits&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result: 'Meter'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcpy import mp
aprx = mp.ArcGISProject("CURRENT")

currentExtent = aprx.activeView.camera.getExtent()
print(currentExtent)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;2697655.50805199 1234784.44214015 2703943.289983 1243768.44124222 NaN NaN NaN NaN&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Screenshot of my ArcGIS Pro and the Notebook:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="schenardi_laixo_1-1678545585769.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65038i2073BBEA7D45A6A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="schenardi_laixo_1-1678545585769.png" alt="schenardi_laixo_1-1678545585769.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 11 Mar 2023 14:48:24 GMT</pubDate>
    <dc:creator>schenardi</dc:creator>
    <dc:date>2023-03-11T14:48:24Z</dc:date>
    <item>
      <title>get current Map extent with correct mapUnits in ArcGIS Pro using arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/get-current-map-extent-with-correct-mapunits-in/m-p/1266833#M67055</link>
      <description>&lt;P&gt;How can I get the current maps extent with configured mapUnits?&lt;/P&gt;&lt;P&gt;Two examples always return the unit of the map projection (Meters) instead of the configured mapUnits (degrees).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;av = aprx.listMaps('Map')[0]
print(av.name)
av.mapUnits&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result: 'Meter'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcpy import mp
aprx = mp.ArcGISProject("CURRENT")

currentExtent = aprx.activeView.camera.getExtent()
print(currentExtent)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;2697655.50805199 1234784.44214015 2703943.289983 1243768.44124222 NaN NaN NaN NaN&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Screenshot of my ArcGIS Pro and the Notebook:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="schenardi_laixo_1-1678545585769.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65038i2073BBEA7D45A6A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="schenardi_laixo_1-1678545585769.png" alt="schenardi_laixo_1-1678545585769.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 14:48:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-current-map-extent-with-correct-mapunits-in/m-p/1266833#M67055</guid>
      <dc:creator>schenardi</dc:creator>
      <dc:date>2023-03-11T14:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: get current Map extent with correct mapUnits in ArcGIS Pro using arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/get-current-map-extent-with-correct-mapunits-in/m-p/1266843#M67056</link>
      <description>&lt;P&gt;You might not be able to directly from the cim but you can use projectAs in the extent class&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/extent.htm" target="_blank"&gt;Extent—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;to convert from the existing extent with its spatial reference (PCS) to a new spatial reference (GCS)&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 16:55:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-current-map-extent-with-correct-mapunits-in/m-p/1266843#M67056</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-03-11T16:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: get current Map extent with correct mapUnits in ArcGIS Pro using arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/get-current-map-extent-with-correct-mapunits-in/m-p/1275355#M67345</link>
      <description>&lt;P&gt;Dan's suggestion is a good one. You could also log an idea for getting the display units from the map, &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/navigation/map-units-location-units-and-display-units.htm" target="_self"&gt;which differ&lt;/A&gt; from the map units.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 16:51:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-current-map-extent-with-correct-mapunits-in/m-p/1275355#M67345</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2023-04-04T16:51:04Z</dc:date>
    </item>
  </channel>
</rss>

