<?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 Open map after importing .mapx using arcpy in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039181#M38826</link>
    <description>&lt;P&gt;After importing a .mapx map file using importDocument(), it appears in the Catalog. Is there a way to then open that map window using arcpy?&lt;/P&gt;</description>
    <pubDate>Mon, 22 Mar 2021 04:42:49 GMT</pubDate>
    <dc:creator>ToyotaT18</dc:creator>
    <dc:date>2021-03-22T04:42:49Z</dc:date>
    <item>
      <title>Open map after importing .mapx using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039181#M38826</link>
      <description>&lt;P&gt;After importing a .mapx map file using importDocument(), it appears in the Catalog. Is there a way to then open that map window using arcpy?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 04:42:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039181#M38826</guid>
      <dc:creator>ToyotaT18</dc:creator>
      <dc:date>2021-03-22T04:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Open map after importing .mapx using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039211#M38828</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/arcgisproject-class.htm" target="_blank" rel="noopener"&gt;ArcGISProject—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/map-class.htm" target="_blank"&gt;Map—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you can get the contents, but there is no "open" method if you follow the arcpy trail&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 09:50:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039211#M38828</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-22T09:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Open map after importing .mapx using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039287#M38834</link>
      <description>&lt;P&gt;You could try using the os.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os
myfile = r"C:\Path\TestProject.aprx"
os.system("start " + myfile)&lt;/LI-CODE&gt;&lt;P&gt;* After some testing this works better.&amp;nbsp; You could also probably use the subprocess Popen too?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os
myfile = r"C:\Path\TestProject.aprx"
os.startfile(myfile)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 14:55:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039287#M38834</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2021-03-22T14:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Open map after importing .mapx using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039567#M38873</link>
      <description>&lt;P&gt;Hi Matthew, that seems to open the file in a new instance of ArcGIS pro, I need it to open in the current session. Do you know if this is possible?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 23:12:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039567#M38873</guid>
      <dc:creator>ToyotaT18</dc:creator>
      <dc:date>2021-03-22T23:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Open map after importing .mapx using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039583#M38875</link>
      <description>&lt;P&gt;it opens a new instance.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is it you want to do?&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can access properties of the aprx etcetera to add to the current project.&lt;/P&gt;&lt;P&gt;It isn't clear what your intent is.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 23:44:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039583#M38875</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-22T23:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Open map after importing .mapx using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039594#M38878</link>
      <description>&lt;P&gt;Hi Dan, as stated in my initial post, my intent is to open a map window which has been imported from a .mapx file. I'm trying to get this to work from a custom geoprocessing tool which is run in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;In the GUI if I select Insert -&amp;gt; Import Map and point to the .mapx file, it adds the map to the 'Maps' section of the catalog, and opens the map window too.&lt;/P&gt;&lt;P&gt;In Arcpy if I use aprx.importDocument('.mapx file') it adds the map to the catalog but doesn't open the map window. I'm trying to work out if I can then open the map window using arcpy.&lt;/P&gt;&lt;P&gt;Hopefully that makes the intent more clear, thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 23:59:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039594#M38878</guid>
      <dc:creator>ToyotaT18</dc:creator>
      <dc:date>2021-03-22T23:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Open map after importing .mapx using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039611#M38880</link>
      <description>&lt;P&gt;That's what I though.&amp;nbsp; In my initial post, I couldn't find any "open" method in either of the links...&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering if you have to construct it from an active mapview, but I definitely haven't tested.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 01:10:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039611#M38880</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-23T01:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Open map after importing .mapx using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039791#M38896</link>
      <description>&lt;P&gt;Not that I can figure out.&amp;nbsp; When I run into situations like this in Pro I will use Tasks.&amp;nbsp; You can have the python script run but don't include the importDocument in a step, make a new step to Import Map (noting exactly how/where to get the map file), ect.&amp;nbsp; You can have each step run automatically one right after another.&amp;nbsp; Not ideal, but if you need a bit of handholding for those less familiar with the software it works great.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also,&amp;nbsp; you might be able to do this with the Pro SDK within IProjectItem then AddItem.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 14:53:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1039791#M38896</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2021-03-23T14:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Open map after importing .mapx using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1419773#M82875</link>
      <description>&lt;P&gt;We are 3 years later but I found a solution:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcpy.mp import ArcGISProject

project = ArcGISProject('current')
new_map_path = r"&amp;lt;path_to_mapx_file&amp;gt;"
new_map = project.importDocument(new_map_path )
new_map.openView()&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;works for me in ArcGIS Pro 3.2.2&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 08:57:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1419773#M82875</guid>
      <dc:creator>Ofir_Mazor</dc:creator>
      <dc:date>2024-05-07T08:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Open map after importing .mapx using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1420821#M83027</link>
      <description>&lt;P&gt;Yep they eventually added the openView() function for maps and layouts.&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 01:22:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/open-map-after-importing-mapx-using-arcpy/m-p/1420821#M83027</guid>
      <dc:creator>ToyotaT18</dc:creator>
      <dc:date>2024-05-09T01:22:00Z</dc:date>
    </item>
  </channel>
</rss>

