<?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 to Selected Layer with Python in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493288#M84629</link>
    <description>&lt;P&gt;Have you tried anything yet?&amp;nbsp; Which part of translating &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/introduction-to-arcpy-mapping.htm" target="_blank" rel="noopener"&gt;arcpy.mapping&lt;/A&gt; code to &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/introduction-to-arcpy-mp.htm" target="_blank" rel="noopener"&gt;arcpy.mp&lt;/A&gt; are you stuck on?&amp;nbsp; I would start with &lt;SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/migratingfrom10xarcpymapping.htm" target="_blank" rel="noopener"&gt;Migrating from arcpy.mapping to ArcGIS Pro&lt;SPAN class=""&gt; - &lt;/SPAN&gt;ArcGIS Pro | Documentation&lt;/A&gt;, it has good code examples to at least get you to opening a specific map.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 15 Jun 2024 16:06:13 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2024-06-15T16:06:13Z</dc:date>
    <item>
      <title>Zoom to Selected Layer with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1492990#M84614</link>
      <description>&lt;P&gt;We have an old python script that zooms to the extent of the layers selected in the dataframe.&amp;nbsp; We are trying to update it for Pro and was hoping someone could point us in the right direction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;import arcpy&lt;BR /&gt;MXD=arcpy.mapping.MapDocument('current')&lt;BR /&gt;dataframe = arcpy.mapping.ListDataFrames(MXD, "Layers")[0]&lt;BR /&gt;dataframe.zoomToSelectedFeatures()&lt;BR /&gt;arcpy.RefreshActiveView()&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 14 Jun 2024 19:28:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1492990#M84614</guid>
      <dc:creator>ZandBakhtiari1</dc:creator>
      <dc:date>2024-06-14T19:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Selected Layer with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493288#M84629</link>
      <description>&lt;P&gt;Have you tried anything yet?&amp;nbsp; Which part of translating &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/introduction-to-arcpy-mapping.htm" target="_blank" rel="noopener"&gt;arcpy.mapping&lt;/A&gt; code to &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/introduction-to-arcpy-mp.htm" target="_blank" rel="noopener"&gt;arcpy.mp&lt;/A&gt; are you stuck on?&amp;nbsp; I would start with &lt;SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/migratingfrom10xarcpymapping.htm" target="_blank" rel="noopener"&gt;Migrating from arcpy.mapping to ArcGIS Pro&lt;SPAN class=""&gt; - &lt;/SPAN&gt;ArcGIS Pro | Documentation&lt;/A&gt;, it has good code examples to at least get you to opening a specific map.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 16:06:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493288#M84629</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-06-15T16:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Selected Layer with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493726#M84643</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp;&amp;nbsp;The part I am stuck on is "&lt;SPAN&gt;zoomToSelectedFeatures()"&amp;nbsp; I cannot find the arcpy,mp equivalent.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 13:58:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493726#M84643</guid>
      <dc:creator>ZandBakhtiari1</dc:creator>
      <dc:date>2024-06-17T13:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Selected Layer with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493739#M84644</link>
      <description>&lt;P&gt;zoomToAllLayers in &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/mapview-class.htm" target="_blank"&gt;MapView—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:20:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493739#M84644</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-06-17T14:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Selected Layer with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493740#M84645</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;I don't want to zoom to all layers.&amp;nbsp; I want to zoom to the selected features &lt;STRONG&gt;within&lt;/STRONG&gt; a layer.&amp;nbsp; Example: Parcel is selected then you right click "Zoom to Selection"&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:27:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493740#M84645</guid>
      <dc:creator>ZandBakhtiari1</dc:creator>
      <dc:date>2024-06-17T14:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Selected Layer with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493750#M84647</link>
      <description>&lt;P&gt;Although the name is zoomToAllLayers, the documentation shows there is a selection_only parameter.&amp;nbsp; The ArcMap script using dataframe.zoomToSelectedFeatures is not layer specific so all selected features across all layers determine the extent, which is the same as zoomToAllLayers.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:33:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493750#M84647</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-06-17T14:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Selected Layer with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493764#M84649</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp;ahhhh I see that now.&amp;nbsp; Thanks to your help I was able to update the script!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;import arcpy&lt;BR /&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;dataframe = aprx.activeView&lt;BR /&gt;dataframe.zoomToAllLayers(True)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:59:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1493764#M84649</guid>
      <dc:creator>ZandBakhtiari1</dc:creator>
      <dc:date>2024-06-17T14:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Selected Layer with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1621940#M96459</link>
      <description>&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject('CURRENT')&lt;BR /&gt;mapas = aprx.listMaps()&lt;BR /&gt;mapa = mapas[0]&lt;BR /&gt;capas= mapa.listLayers()&lt;BR /&gt;aprx.activeView.camera.setExtent(arcpy.Describe(capas[0]).extent)&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 18:58:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/zoom-to-selected-layer-with-python/m-p/1621940#M96459</guid>
      <dc:creator>FranklinMedina</dc:creator>
      <dc:date>2025-06-09T18:58:28Z</dc:date>
    </item>
  </channel>
</rss>

