<?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: set map in contents pane in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/set-map-in-contents-pane/m-p/1581392#M73694</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/871138"&gt;@JosepFaneca&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the same functionality, you should report as a possible bug and/or create a new idea for this functionality to work outside of ArcGIS Pro in a standalone script.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Feb 2025 17:25:18 GMT</pubDate>
    <dc:creator>Clubdebambos</dc:creator>
    <dc:date>2025-02-03T17:25:18Z</dc:date>
    <item>
      <title>set map in contents pane</title>
      <link>https://community.esri.com/t5/python-questions/set-map-in-contents-pane/m-p/1577730#M73590</link>
      <description>&lt;PRE&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;
I am importing mxd projects to aprx with a python script. &lt;BR /&gt;I need the imported map to appear in the content panel. &lt;BR /&gt;Right now it only appears in the Catalog panel. My script is the following:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;current_dir =  os.path.abspath(os.path.dirname(__file__))&lt;BR /&gt;arcpy.env.workspace = current_dir&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;mxds = arcpy.ListFiles(&lt;SPAN&gt;"*.mxd"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;i &lt;SPAN&gt;in &lt;/SPAN&gt;mxds:&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;newAprx=i[:-&lt;SPAN&gt;4&lt;/SPAN&gt;]+&lt;SPAN&gt;".aprx"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Convirtiendo " &lt;/SPAN&gt;+ i + &lt;SPAN&gt;" en " &lt;/SPAN&gt;+ newAprx)&lt;BR /&gt;&lt;BR /&gt;tempProject= &lt;SPAN&gt;"temp.aprx" &lt;/SPAN&gt;&lt;SPAN&gt;#blank template&lt;BR /&gt;&lt;/SPAN&gt;x=os.path.join(current_dir&lt;SPAN&gt;, &lt;/SPAN&gt;newAprx) &lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#--- Creating APRX ---&lt;BR /&gt;&lt;/SPAN&gt;aprx=arcpy.mp.ArcGISProject(tempProject) &lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;aprx.saveACopy(x) &lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;aprx.importDocument(current_dir+&lt;SPAN&gt;"//"&lt;/SPAN&gt;+i) &lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;aprx.saveACopy(x) &lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 09:32:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-map-in-contents-pane/m-p/1577730#M73590</guid>
      <dc:creator>JosepFaneca</dc:creator>
      <dc:date>2025-01-22T09:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: set map in contents pane</title>
      <link>https://community.esri.com/t5/python-questions/set-map-in-contents-pane/m-p/1577759#M73591</link>
      <description>&lt;P&gt;So, it looks like there was a similar post some time ago and they recently found a solution.&amp;nbsp; That post referenced importing a mapx and opening the map (&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1419773#M82875" target="_blank"&gt;Solved: Re: Open map after importing .mapx using arcpy - Esri Community&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;So, I would adapt that code something like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx.importDocument(current_dir+"//"+i)
aprx.openView()
aprx.saveACopy(x)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Jan 2025 13:44:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-map-in-contents-pane/m-p/1577759#M73591</guid>
      <dc:creator>LauraBecht</dc:creator>
      <dc:date>2025-01-22T13:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: set map in contents pane</title>
      <link>https://community.esri.com/t5/python-questions/set-map-in-contents-pane/m-p/1578147#M73622</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Sorry, but&amp;nbsp;ArcGISProject class does not have the method openView(), is a method of Map class.&lt;/P&gt;&lt;P&gt;I'm runnig a python file from an IDE and this part of script&amp;nbsp; has no effect:&lt;/P&gt;&lt;P&gt;project = arcpy.mp.ArcGISProject(newAprx)&lt;BR /&gt;project.closeViews("MAPS")&lt;BR /&gt;&lt;STRONG&gt;project.listMaps()[0].openView()&lt;/STRONG&gt;&lt;BR /&gt;project.save()&lt;/P&gt;&lt;P&gt;however, in the ArcGis Pro python window console it adds the map to the contents pane:&lt;/P&gt;&lt;P&gt;before&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JosepFaneca_0-1737632041448.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123828i38FE1F2E0A15408A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JosepFaneca_0-1737632041448.png" alt="JosepFaneca_0-1737632041448.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;after run command in python window&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JosepFaneca_1-1737632169726.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123829i998EAA62F94B539B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JosepFaneca_1-1737632169726.png" alt="JosepFaneca_1-1737632169726.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 11:38:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-map-in-contents-pane/m-p/1578147#M73622</guid>
      <dc:creator>JosepFaneca</dc:creator>
      <dc:date>2025-01-23T11:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: set map in contents pane</title>
      <link>https://community.esri.com/t5/python-questions/set-map-in-contents-pane/m-p/1581392#M73694</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/871138"&gt;@JosepFaneca&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the same functionality, you should report as a possible bug and/or create a new idea for this functionality to work outside of ArcGIS Pro in a standalone script.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2025 17:25:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-map-in-contents-pane/m-p/1581392#M73694</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2025-02-03T17:25:18Z</dc:date>
    </item>
  </channel>
</rss>

