<?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 Re: Getting current map frame extent without having to save the project each time? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/getting-current-map-frame-extent-without-having-to/m-p/1053957#M61004</link>
    <description>&lt;P&gt;aprx.activeView.camera.setExtent(ext)&amp;nbsp; # and there is getExtent&lt;/P&gt;&lt;P&gt;It think that this is full circle and the setExtent and getExtent were added in recent versions of Pro.&lt;/P&gt;&lt;P&gt;I don't know how otherwise you would implement this in a python script other than grabbing this parameter after the script is actually run&lt;/P&gt;</description>
    <pubDate>Mon, 03 May 2021 20:05:08 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-05-03T20:05:08Z</dc:date>
    <item>
      <title>Getting current map frame extent without having to save the project each time?</title>
      <link>https://community.esri.com/t5/python-questions/getting-current-map-frame-extent-without-having-to/m-p/1053945#M61003</link>
      <description>&lt;P&gt;I can get a map's view extent by doing this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p = arcpy.mp.ArcGISProject('CURRENT')
m = p.listMaps()[0]
e = m.defaultCamera.getExtent()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However this is real janky because a user can move the map and re-run the code, and it doesn't update until the project is saved.&amp;nbsp; This has been the case from what I can tell, for around five years now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe it's easier to explain what I need to do.&amp;nbsp; In a script tool, I need to set the &lt;FONT face="courier new,courier"&gt;arcpy.env.extent&lt;/FONT&gt; parameter to "&lt;STRONG&gt;Same as display&lt;/STRONG&gt;" but do it with python rather than forcing a user to manually select "same as display" in the GUI every single time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a "best practice" to implement this behavior in python?&amp;nbsp; I had read that this property was made available to python sometime recently, but I can't find any documentation on it.&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 19:43:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-current-map-frame-extent-without-having-to/m-p/1053945#M61003</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2021-05-03T19:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting current map frame extent without having to save the project each time?</title>
      <link>https://community.esri.com/t5/python-questions/getting-current-map-frame-extent-without-having-to/m-p/1053957#M61004</link>
      <description>&lt;P&gt;aprx.activeView.camera.setExtent(ext)&amp;nbsp; # and there is getExtent&lt;/P&gt;&lt;P&gt;It think that this is full circle and the setExtent and getExtent were added in recent versions of Pro.&lt;/P&gt;&lt;P&gt;I don't know how otherwise you would implement this in a python script other than grabbing this parameter after the script is actually run&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 20:05:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-current-map-frame-extent-without-having-to/m-p/1053957#M61004</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-05-03T20:05:08Z</dc:date>
    </item>
  </channel>
</rss>

