<?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: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279250#M21578</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your last sentence seems to contradict itself, could you be a little clearer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Camera is the only thing now that controls extents and scales, since there is no longer a dataframe, so it seems like changing the Camera would be to go about this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
aprx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"C:\Projects\YosemiteNP\Yosemite.aprx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

m &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMaps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Yose*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
lyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; m&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Ranger Stations"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
lyt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listLayouts&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Main Attr*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
mf &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; lyt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listElements&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"mapframe_element"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Yosemite National Park"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
mf&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;camera&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;setExtent&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mf&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getLayerExtent&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;saveACopy&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"C:\Projects\YosemiteNP\Yosemite_Updated.aprx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; aprx‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried&amp;nbsp;setting the camera of both the map frame and map?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also would you mind posting your code ths far you've been trying?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/bixb0012" target="_blank"&gt;bixb0012&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 13:34:36 GMT</pubDate>
    <dc:creator>IanMurray</dc:creator>
    <dc:date>2021-12-11T13:34:36Z</dc:date>
    <item>
      <title>Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279247#M21575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm writing code to create new ArcGIS Pro Projects using the Pro arcpy &amp;nbsp;(package arcpy.mp)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doing something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy.mp&lt;BR /&gt;aprx = arcpy.mp.ArcGISProject(r"C:\temp\Empty.aprx")&lt;BR /&gt;map = aprx.listMaps()[0]&lt;BR /&gt;map.map.addDataFromPath(r"C:\Users\xxxxxx\Documents\Test1\Orthomosaic.tif")&lt;BR /&gt;aprx.saveACopy(r"C:\temp\jNew.aprx")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I can't figure out to zoom the map to the extent of Orthomosaic.tif (or any other extent for that matter).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the docs at &amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/alphabeticallistofclasses.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/mapping/alphabeticallistofclasses.htm"&gt;Alphabetical list of arcpy.mp classes—ArcPy | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see that a MapFrame has a&amp;nbsp;zoomToAllLayers method, but a MapFrame is only available on a Layout element.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone know how to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 20:08:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279247#M21575</guid>
      <dc:creator>JamesTaylor3</dc:creator>
      <dc:date>2017-05-02T20:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279248#M21576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't use ArcGIS Pro yet, but looking at the various helps, I would guess you would need to get the extent object of your layer and then apply that extent a Camera Object, which you can use to overwrite the default Camera object in your Map or Mapframe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Example on the Camera Help my point you in the right direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/camera-class.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/mapping/camera-class.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/mapframe-class.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/mapping/mapframe-class.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/map-class.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/mapping/map-class.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 20:45:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279248#M21576</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-05-02T20:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279249#M21577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's this statement:&lt;/P&gt;&lt;P&gt;Extent is not a direct property of the Camera object because it is not an explicit property but rather a derived property. Camera positions do not store extent properties, but from an X, Y location and a scale, extent is derived. The getExtent method will return a derived extent. When an extent is returned from a 3D map view, it is based on the camera position looking straight down (pitch=-90). When the setExtent method is used on a 3D map, again, the result will appear as if the camera is looking straight down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I have tried setting X,Y and Scale but they don't seem to take. &amp;nbsp;They always remain nan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried zooming a layout and copying the camera from that to the Map.defaultCamera. &amp;nbsp; The extent on the map seems correct on the Map when you open the project, however ArcGIS Pro doesn't zoom the map to that extent when you open the project.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 20:51:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279249#M21577</guid>
      <dc:creator>JamesTaylor3</dc:creator>
      <dc:date>2017-05-02T20:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279250#M21578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your last sentence seems to contradict itself, could you be a little clearer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Camera is the only thing now that controls extents and scales, since there is no longer a dataframe, so it seems like changing the Camera would be to go about this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
aprx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"C:\Projects\YosemiteNP\Yosemite.aprx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

m &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMaps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Yose*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
lyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; m&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Ranger Stations"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
lyt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listLayouts&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Main Attr*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
mf &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; lyt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listElements&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"mapframe_element"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Yosemite National Park"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
mf&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;camera&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;setExtent&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mf&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getLayerExtent&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;saveACopy&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"C:\Projects\YosemiteNP\Yosemite_Updated.aprx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; aprx‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried&amp;nbsp;setting the camera of both the map frame and map?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also would you mind posting your code ths far you've been trying?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/bixb0012" target="_blank"&gt;bixb0012&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:34:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279250#M21578</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2021-12-11T13:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279251#M21579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The example you listed above only zooms the Layout, not the Map that the Layout contains.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried setting both the MapFrame and the Map. &amp;nbsp;That's what I was trying to say in the last sentence of my last post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is essentially this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;import arcpy.mp&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;aprx = arcpy.mp.ArcGISProject(r"C:\temp\Empty.aprx")&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;map = aprx.listMaps()[0]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;layout = aprx.listLayouts()[0]&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;map.map.addDataFromPath(r"C:\Users\xxxxxx\Documents\Test1\Orthomosaic.tif")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;mapFrame =&amp;nbsp;&lt;SPAN class="" style="color: #4d4d4d;"&gt;layout&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;listElements&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;"MAPFRAME_ELEMENT"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;)[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #666666;"&gt;0&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;mapFrame.zoomToAllLayers()&lt;/P&gt;&lt;P&gt;map.defaultCamera = mapFrame.camera&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;aprx.saveACopy(r"C:\temp\New.aprx")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;And the Map is added to the Layout in Empty.aprx before I run this code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Now when I open New.aprx the map is NOT zoomed to the extent of all layers (the extent of Orthomasaic.tif), however if you look at the Map Properties its extent is set to the extent of all layers&amp;nbsp;&lt;SPAN&gt;(the extent of Orthomasaic.tif).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 21:42:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279251#M21579</guid>
      <dc:creator>JamesTaylor3</dc:creator>
      <dc:date>2017-05-02T21:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279252#M21580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order to modify the extent, scale, etc... using ArcPy; you need to retrieve the camera of a mapframe, not the defaultCamera of a map.&amp;nbsp; Insert a layout, insert a mapframe tied to a map, and then you can set the extent, scale, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Example code will come later)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 21:51:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279252#M21580</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-05-02T21:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279253#M21581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I uploaded my code, project and image for testing to here:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-10001-zoom-to-a-layer-in-arcgis-pro-project-using-arcpymp" target="_blank"&gt;https://community.esri.com/docs/DOC-10001-zoom-to-a-layer-in-arcgis-pro-project-using-arcpymp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy.mp

try:
 aprx = arcpy.mp.ArcGISProject(r"C:\Temp\ArcPro\Empty.aprx")
 
 map = aprx.listMaps()[0]
 print(map.name)
 
 layout = aprx.listLayouts()[0]
 mapframe = layout.listElements("MAPFRAME_ELEMENT")[0]
 print (mapframe.name)
 print (mapframe.map.name)

 ext = mapframe.camera.getExtent()
 print ("MapFrame Extent: " + ext.JSON)

 mapframe.map.addDataFromPath(r"C:\Temp\ArcPro\Orthomosaic.tif")
 mapframe.zoomToAllLayers()

 ext = mapframe.camera.getExtent()
 print ("MapFrame Extent: " + ext.JSON)

 mapext = map.defaultCamera.getExtent()
 print ("Map Extent: " + mapext.JSON)

 aprx.saveACopy(r"C:\Temp\ArcPro\New.aprx")

except Exception as err:
 print("Error Aprx. %s" % str(err))&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the output:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;MyMap&lt;BR /&gt;My Map Frame&lt;BR /&gt;MyMap&lt;BR /&gt;MapFrame Extent: {"xmin":-13520478.935883986,"ymin":2728123.2144682845,"xmax":-10568557.934067367,"ymax":6815398.4477528343,"spatialReference":{"wkid":32632,"latestWkid":32632}}&lt;BR /&gt;MapFrame Extent: {"xmin":424855.68683000002,"ymin":5132283.3477261541,"xmax":425127.21863000002,"ymax":5132659.3148338469,"spatialReference":{"wkid":32632,"latestWkid":32632}}&lt;BR /&gt;Map Extent: {"xmin":424842.11024000001,"ymin":5132306.757046001,"xmax":425140.79522000003,"ymax":5132635.9055140009,"spatialReference":{"wkid":32632,"latestWkid":32632}}&lt;BR /&gt;Press any key to continue . . .&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;When you open New.aprx in ArcGIS Pro the Layout is zoomed to Orthomosaic.tif, but MyMap is not, even though the Map Extent looks correct and is the same as the MapFrame Extent.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:34:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279253#M21581</guid>
      <dc:creator>JamesTaylor3</dc:creator>
      <dc:date>2021-12-11T13:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279254#M21582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just talked to an arcpy.mp developer and he said zooming on a Map View is not supported in arcpy.mp yet and probably will not be for awhile.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 16:37:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279254#M21582</guid>
      <dc:creator>JamesTaylor3</dc:creator>
      <dc:date>2017-05-03T16:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279255#M21583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to get this working on ArcGIS Pro 2.1.2 (but previous versions may work as well).&amp;nbsp; It seems to only work if I run it from the command line, not from within the Pro python window.&amp;nbsp; Here is the code in case anyone is trying to do something similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code queries a layer for a feature with a specific ID, then zooms the mapframe to the extent of the feature and outputs a PDF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;project = arcpy.mp.ArcGISProject("//mapserver/blah/Pro-workforce2.aprx")&lt;BR /&gt;map = project.listMaps()[0]&lt;/P&gt;&lt;P&gt;whereZoom = "BlahID = '20181520528'"&lt;/P&gt;&lt;P&gt;layer = map.listLayers("Zoom")[0]&lt;BR /&gt;arcpy.SelectLayerByAttribute_management(layer,"NEW_SELECTION",whereZoom)&lt;/P&gt;&lt;P&gt;lyt = project.listLayouts()[0]&lt;/P&gt;&lt;P&gt;mf = lyt.listElements('MAPFRAME_ELEMENT','*')[0]&lt;BR /&gt;mf.camera.setExtent(mf.getLayerExtent(layer,True,True))&lt;BR /&gt;mf.zoomToAllLayers()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;lyt.exportToPDF("//mapserver/blah/test-%s.pdf" % whereZoom)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 13:05:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279255#M21583</guid>
      <dc:creator>MarkHammond</dc:creator>
      <dc:date>2018-04-20T13:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279256#M21584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This&amp;nbsp;bit of code&amp;nbsp;works like a charm, thanks for posting Mark Hammond.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2018 19:58:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279256#M21584</guid>
      <dc:creator>HenryWhitenack</dc:creator>
      <dc:date>2018-06-19T19:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279257#M21585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for sharing.&lt;/P&gt;&lt;P&gt;This works for the layout view, but it won't change the map extent in the mapview.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't believe it that this function has not been implemented in ArcGIS Pro 2.2.0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2018 08:02:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279257#M21585</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-07-03T08:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279258#M21586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've created a ArcGIS Idea for this function to be considered by ESRI. Please vote it up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/ideas/15227" target="_blank"&gt;https://community.esri.com/ideas/15227&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jun 2021 08:27:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279258#M21586</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2021-06-22T08:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279259#M21587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I posted and up-voted on the &lt;A _jive_internal="true" href="https://community.esri.com/ideas/15227-allow-arcpymp-to-change-the-map-extent-in-arcgis-pro"&gt;ArcGIS Idea above&lt;/A&gt;, but posting here too in case it helps anyone...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;You can sort-of&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;hack this workflow in ArcPro by running the script in a Task Step and ending with a selection rather than a zoom extent. Then, pass the selection to a second Task Step which runs the Zoom To Selection command. It is not great, slower and clunkier than simply running the script directly, but I have gotten it to work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2018 19:25:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279259#M21587</guid>
      <dc:creator>AustinRobey1</dc:creator>
      <dc:date>2018-12-21T19:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279260#M21588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;{"xmin":-13520478.935883986,"ymin":2728123.2144682845,"xmax":-10568557.934067367,"ymax":6815398.4477528343,"spatialReference":{"wkid":32632,"latestWkid":32632}}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Do you know what units the map frame extent coordinates are in? I am having a similar issue. thank you&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2020 16:06:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/279260#M21588</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-10-13T16:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1008505#M59247</link>
      <description>&lt;P&gt;Is it still the case that zoom to extent on the map view is not supported in arcpy? So far, my searching makes me think that it is not. thanks&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:39:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1008505#M59247</guid>
      <dc:creator>ChrisHolmes</dc:creator>
      <dc:date>2020-12-10T15:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1008615#M59249</link>
      <description>&lt;P&gt;Since 2018 when this thread was opened, ArcPy has added functionality.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")
ext = # ArcPy Extent Object
aprx.activeView.camera.setExtent(ext)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The activeView property returns either the active map or active layout, and the camera can be accessed to set the extent.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 18:49:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1008615#M59249</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-12-10T18:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1008688#M59251</link>
      <description>&lt;P&gt;Yes, agreed. I was able to zoom to extents on the active view. But there's no way to do this on a map view that is not active or when working with a project that is not currently open in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 21:27:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1008688#M59251</guid>
      <dc:creator>ChrisHolmes</dc:creator>
      <dc:date>2020-12-10T21:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1009332#M59265</link>
      <description>&lt;P&gt;Having spent some time with the layout and mapframe I am now using zoom to extent and set scale on the map frame which works well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having said that the end use will still need to manually zoom to extent in the map view to do their work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChrisHolmes_0-1607963259856.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/2086i9FC0E052E8B8BA5D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChrisHolmes_0-1607963259856.png" alt="ChrisHolmes_0-1607963259856.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally I would have liked to loop through all map views using arcpy and complete the zoom to extent before the aprx file opens so that all map views would be focused on the appropriate parcel when it opens, but this will have to do.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 16:29:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1009332#M59265</guid>
      <dc:creator>ChrisHolmes</dc:creator>
      <dc:date>2020-12-14T16:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1010116#M59294</link>
      <description>&lt;P&gt;Wondering if the zoom to selected feature in ArcPy on the Map View versus the Map Frame has been resolved?&amp;nbsp; I am trying to do a select feature by attribute in Model Builder (ARCPRO) and zoom to the selected features.&amp;nbsp; &amp;nbsp;I attempted to locate your submitted Idea but the link is broken.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 12:58:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1010116#M59294</guid>
      <dc:creator>PattyLake1</dc:creator>
      <dc:date>2020-12-16T12:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom map to the extent of a layer in Arcpy.mp (ArcGIS Pro Project)</title>
      <link>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1010662#M59313</link>
      <description>&lt;P&gt;As Joshua mentioned and as far as I can see you can only zoom on the active map view. Otherwise it must be done on a layout/map frame.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 16:55:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-map-to-the-extent-of-a-layer-in-arcpy-mp/m-p/1010662#M59313</guid>
      <dc:creator>ChrisHolmes</dc:creator>
      <dc:date>2020-12-17T16:55:40Z</dc:date>
    </item>
  </channel>
</rss>

