<?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>idea ArcGIS Pro: Arcpy View Layout (make viewable) in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idi-p/930783</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;There is a method in arcpy to import a layout into a ArcPro document (aprx.importDocument('path to pagx'). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;This imports it into the project but does not&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;&lt;EM&gt;show&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the layout by default so a user may not know that the layout had been added (i.e. it requires use of the Catalog view in the UI to navigate to that layout and then view it/open it).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;There are also other project items which it would be useful to have arcpy control over their visibility status in the main stage (i.e. maps, scenes)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Please add a property on maps, layouts, scenes etc to control their visibility.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;i.e.&lt;/P&gt;&lt;P style="border: 0px;"&gt;aprx = arcpy.mp.ArcGISProject("Current")&lt;/P&gt;&lt;P style="border: 0px;"&gt;aprx.importDocument("path to pagx file")&lt;/P&gt;&lt;P style="border: 0px;"&gt;layout = aprx.listLayouts('pagx layout I just imported")[0]&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;STRONG&gt;layout.visible = True # This will show the layout in the main stage&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;STRONG&gt;layout.visible = False # This will remove the layout from the main stage, but still keep it in the project.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Mar 2020 02:53:54 GMT</pubDate>
    <dc:creator>GeoNZ</dc:creator>
    <dc:date>2020-03-17T02:53:54Z</dc:date>
    <item>
      <title>ArcGIS Pro: Arcpy View Layout (make viewable)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idi-p/930783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;There is a method in arcpy to import a layout into a ArcPro document (aprx.importDocument('path to pagx'). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;This imports it into the project but does not&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;&lt;EM&gt;show&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the layout by default so a user may not know that the layout had been added (i.e. it requires use of the Catalog view in the UI to navigate to that layout and then view it/open it).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;There are also other project items which it would be useful to have arcpy control over their visibility status in the main stage (i.e. maps, scenes)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Please add a property on maps, layouts, scenes etc to control their visibility.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;i.e.&lt;/P&gt;&lt;P style="border: 0px;"&gt;aprx = arcpy.mp.ArcGISProject("Current")&lt;/P&gt;&lt;P style="border: 0px;"&gt;aprx.importDocument("path to pagx file")&lt;/P&gt;&lt;P style="border: 0px;"&gt;layout = aprx.listLayouts('pagx layout I just imported")[0]&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;STRONG&gt;layout.visible = True # This will show the layout in the main stage&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;STRONG&gt;layout.visible = False # This will remove the layout from the main stage, but still keep it in the project.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 02:53:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idi-p/930783</guid>
      <dc:creator>GeoNZ</dc:creator>
      <dc:date>2020-03-17T02:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro: Arcpy View Layout (make viewable) - Status changed to: In Product Plan</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1159611#M19205</link>
      <description>&lt;P&gt;This is addressed in Pro 3.0.&amp;nbsp; Similar to your idea, we have an OpenView() method on the Layout and Map objects.&amp;nbsp; We also have a ArcGISProject.CloseViews() method too.&lt;/P&gt;&lt;P&gt;So to address your scenario, before importing a pagx, you might want to also close all other map and layout views.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;p = arcpy.mp.ArcGISProject('current')&lt;BR /&gt;p.importDocument(pagx_path)&lt;BR /&gt;p.closeViews() #Default is "MAPS_AND_LAYOUTS"&amp;nbsp; or "MAPS" or "LAYOUTS"&lt;BR /&gt;lyt = p.listLayouts('MyLayout')[0]&lt;BR /&gt;lyt.openView()&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I hope you are excited by this new feature.&lt;/P&gt;&lt;P&gt;Jeff - Layout and arcpy.mp Teams&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 19:46:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1159611#M19205</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2022-03-30T19:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro: Arcpy View Layout (make viewable) - Status changed to: Implemented</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1186299#M20066</link>
      <description>&lt;P&gt;This functionality has been added in ArcGIS Pro 3.0. See&amp;nbsp;&lt;LI-MESSAGE title="Ideas in ArcGIS Pro 3.0" uid="1183725" url="https://community.esri.com/t5/arcgis-ideas-blog/ideas-in-arcgis-pro-3-0/m-p/1183725#U1183725" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&amp;nbsp;to see this and all of the other ideas you can look forward to when you upgrade.&lt;/P&gt;&lt;P&gt;Also be sure to check out the What's New documentation:&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/get-started/whats-new-in-arcgis-pro.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/get-started/whats-new-in-arcgis-pro.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 20:47:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1186299#M20066</guid>
      <dc:creator>KoryKramer</dc:creator>
      <dc:date>2022-06-24T20:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro: Arcpy View Layout (make viewable)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1219152#M21552</link>
      <description>&lt;P&gt;Hello there. I'm trying to use the &lt;STRONG&gt;openView()&lt;/STRONG&gt; method, configured the same way as in your example above, and I get the following traceback:&lt;BR /&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 2, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py", line 1885, in openView&lt;BR /&gt;return convertArcObjectToPythonObject(self._arc_object.openView(*gp_fixargs((), True)))&lt;BR /&gt;RuntimeError&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 22:18:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1219152#M21552</guid>
      <dc:creator>taylor</dc:creator>
      <dc:date>2022-10-05T22:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro: Arcpy View Layout (make viewable)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1219167#M21560</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/607519"&gt;@taylor&lt;/a&gt;&amp;nbsp;can you please provide more information.&amp;nbsp; Can I see more of the script?&amp;nbsp; Are you running it from a script tool, the Python Window?&lt;/P&gt;&lt;P&gt;I can NOT reproduce your scenario, I'll need more information.&lt;/P&gt;&lt;P&gt;Jeff - Layout and arcpy.mp teams&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 23:06:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1219167#M21560</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2022-10-05T23:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro: Arcpy View Layout (make viewable)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1220384#M21606</link>
      <description>&lt;P&gt;Good morning&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134"&gt;@JeffBarrette&lt;/a&gt;&amp;nbsp;, here's the section of my script that depends on openView() to be worth running:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;#import arcpy, set variables&lt;BR /&gt;import arcpy&lt;BR /&gt;&lt;/SPAN&gt;foo = "AOI"&lt;BR /&gt;dlDate = "10102022"&lt;BR /&gt;lOr = 'P'&lt;/PRE&gt;&lt;PRE&gt;#set workspace and project&lt;BR /&gt;arcpy.env.workspace = fr"C:\mypath\{AOI}_{dlDate}.gdb"&lt;BR /&gt;projAGP = arcpy.mp.ArcGISProject(&lt;SPAN&gt;"CURRENT"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;#import portrait or landscape template depending on &lt;STRONG&gt;lOr&lt;/STRONG&gt; var value&lt;BR /&gt;if &lt;/SPAN&gt;lOr == &lt;SPAN&gt;'P'&lt;/SPAN&gt;:&lt;BR /&gt;    projAGP.importDocument(&lt;SPAN&gt;r"D:\localGISws_TPC\ESH21_mapbook_wkspc\layoutFiles\tempPortrait.pagx"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;if &lt;/SPAN&gt;lOr == &lt;SPAN&gt;'L'&lt;/SPAN&gt;:&lt;BR /&gt;    projAGP.importDocument(&lt;SPAN&gt;r"D:\localGISws_TPC\ESH21_mapbook_wkspc\layoutFiles\tempLandscape.pagx"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;#rename layout using string stored in &lt;STRONG&gt;AOI&lt;/STRONG&gt; var&lt;BR /&gt;allLayouts = projAGP.listLayouts()&lt;BR /&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;l &lt;SPAN&gt;in &lt;/SPAN&gt;allLayouts:&lt;BR /&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;l.name == &lt;SPAN&gt;'tempPortrait_new'&lt;/SPAN&gt;:&lt;BR /&gt;        l.name = AOI&lt;BR /&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;l.name == &lt;SPAN&gt;'tempLandscape_new'&lt;/SPAN&gt;:&lt;BR /&gt;        l.name = AOI&lt;BR /&gt;&lt;BR /&gt;#verify existence of layout named {AOI}&lt;BR /&gt;currLayoutNm = projAGP.listLayouts(AOI)[&lt;SPAN&gt;0&lt;/SPAN&gt;]&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;f'Current Layout is &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;currLayoutNm.name&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;.'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;#trying to pass Layout object to variable &lt;BR /&gt;#(this is just the latest approach I've tried; seems to me I could just pass &lt;STRONG&gt;currLayoutNm&lt;BR /&gt;&lt;/STRONG&gt;#to openView as well. Here, I'm rebuilding a layout list, in case &lt;STRONG&gt;.listLayouts() &lt;/STRONG&gt;is referencing &lt;BR /&gt;#some list that's stuck in memory (non-refreshed) or some other random thing &lt;BR /&gt;&lt;BR /&gt;fullLayoutList = []&lt;BR /&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;l &lt;SPAN&gt;in &lt;/SPAN&gt;projAGP.listLayouts():&lt;BR /&gt;    fullLayoutList.append(l.name)&lt;BR /&gt;iPos = fullLayoutList.index(AOI)&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(iPos)&lt;BR /&gt;&lt;BR /&gt;currLayout = projAGP.listLayouts()[iPos]&lt;/PRE&gt;&lt;PRE&gt;currLayout.openView()&lt;BR /&gt;#breaks with the RunTimeError referenced in previous post, 90+% of the time. &lt;BR /&gt;#Oddly (and infuriatingly) sometimes if I wait for a while and pass this command,&lt;BR /&gt;#it works and opens the layout.&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2022 15:33:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1220384#M21606</guid>
      <dc:creator>taylor</dc:creator>
      <dc:date>2022-10-10T15:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro: Arcpy View Layout (make viewable)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1220388#M21607</link>
      <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134" target="_blank" rel="noopener"&gt;@JeffBarrette&lt;/A&gt;&amp;nbsp;I'm writing my script in PyCharm and pasting it to the Python Window.&lt;BR /&gt;&lt;BR /&gt;The thing here that has really burned a lot of time and patience is that the openView() &lt;EM&gt;works sometimes&lt;/EM&gt;. I'm sorry to say, but this behavior is consistent with everything in the ESRI universe.&lt;/P&gt;&lt;P&gt;Another example of what I'll generously call "quirkiness" is that setting the workspace environment wouldn't "take". Anytime I tried to reference a dataset, I would receive errors indicating it didn't exist, and trying to retrieve field lists would return []. Yet when I would run this part of my script in PyCharm (yes, referencing the same python interpreter as AGP and the Python Window), it would work just fine. What's the deal here? I've seen a lot of reports of this kind of behavior on many of the forums. Until the Python Window (or Notebook, which is even worse), can be made to behave reliably, is there any way to integrate PyCharm to the AGP interface?&lt;BR /&gt;&lt;BR /&gt;Hoping there's something wrong with my script, so I can leverage arcpy to get work done efficiently, rather than use the AGP interface to edit the many layouts I'm trying to get done. Do I need to pre-configure the Python Window in some way? Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 15:30:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1220388#M21607</guid>
      <dc:creator>taylor</dc:creator>
      <dc:date>2022-10-10T15:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro: Arcpy View Layout (make viewable)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1220432#M21613</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/607519"&gt;@taylor&lt;/a&gt;&amp;nbsp;I was able to reproduce your error.&amp;nbsp; I've created a bug in our system and we are investigating it.&lt;/P&gt;&lt;P&gt;Thanks you!&lt;/P&gt;&lt;P&gt;Jeff - Layout and arcpy.mp teams&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 17:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1220432#M21613</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2022-10-10T17:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro: Arcpy View Layout (make viewable)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1220470#M21615</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134"&gt;@JeffBarrette&lt;/a&gt;&amp;nbsp;for your response. Let me know what you all come up with!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 18:52:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1220470#M21615</guid>
      <dc:creator>taylor</dc:creator>
      <dc:date>2022-10-10T18:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro: Arcpy View Layout (make viewable)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1246781#M22744</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134"&gt;@JeffBarrette&lt;/a&gt;&amp;nbsp;I'm having the same issue with openView(). I am able to use importDocument() successfully, but openView() will not display my imported Layout.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 14:43:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1246781#M22744</guid>
      <dc:creator>jdaniel</dc:creator>
      <dc:date>2023-01-10T14:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro: Arcpy View Layout (make viewable)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1247869#M22828</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/420721"&gt;@jdaniel&lt;/a&gt;&amp;nbsp;this was addressed in 3.1 based on&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/607519"&gt;@taylor&lt;/a&gt;&amp;nbsp;'s workflow and scripts.&lt;/P&gt;&lt;P&gt;Please test when ArcGIS Pro 3.1.&amp;nbsp; It is scheduled to be released in late Feb.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jeff - Layout and arcpy.mp teams&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 22:19:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcgis-pro-arcpy-view-layout-make-viewable/idc-p/1247869#M22828</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2023-01-12T22:19:52Z</dc:date>
    </item>
  </channel>
</rss>

