<?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: Import a Layout from PAGX without adding it to Project? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/import-a-layout-from-pagx-without-adding-it-to/m-p/806318#M2192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My issue is that I don't want the Layout to become a part of the Project at all - I just want the in-memory Layout object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jan 2020 21:29:15 GMT</pubDate>
    <dc:creator>DavidLaMartina</dc:creator>
    <dc:date>2020-01-10T21:29:15Z</dc:date>
    <item>
      <title>Import a Layout from PAGX without adding it to Project?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/import-a-layout-from-pagx-without-adding-it-to/m-p/806316#M2190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to be able import a Layout from a PAGX file without actually adding it to the Project's set of ProjectItems. Is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus far, the only way I have found to import from PAGX programatically (and grab the recently added Layout) is to do something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Item importedProjectItem = GetImportedLayoutProjectItem(workingDirectoryPath);

 await QueuedTask.Run(() =&amp;gt;
 {
 List&amp;lt;LayoutProjectItem&amp;gt; layoutProjectItemsBeforeImport = Project.Current.GetItems&amp;lt;LayoutProjectItem&amp;gt;().ToList();

 Project.Current.AddItem((IProjectItem)importedProjectItem);

 LayoutProjectItem importedLayoutProjectItem = Project.Current.GetItems&amp;lt;LayoutProjectItem&amp;gt;().FirstOrDefault(item =&amp;gt; !layoutProjectItemsBeforeImport.Contains(item));
 }
});&lt;/PRE&gt;&lt;P&gt;Of course, the call to Project.Current.AddItem() adds the Layout to the Project, which automatically brings up the Layout for editing in the GUI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried casting the Item in various places, and that never works - It seems that an actual LayoutProjectItem is not created - and thus the Layout object itself is not created - until the call to AddItem(). But is there a way to create a Layout object from a PAGX file without going through these steps?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:56:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/import-a-layout-from-pagx-without-adding-it-to/m-p/806316#M2190</guid>
      <dc:creator>DavidLaMartina</dc:creator>
      <dc:date>2021-12-12T16:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Import a Layout from PAGX without adding it to Project?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/import-a-layout-from-pagx-without-adding-it-to/m-p/806317#M2191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;don't save the project and it will not add the layout to the project. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2020 21:20:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/import-a-layout-from-pagx-without-adding-it-to/m-p/806317#M2191</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2020-01-10T21:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Import a Layout from PAGX without adding it to Project?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/import-a-layout-from-pagx-without-adding-it-to/m-p/806318#M2192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My issue is that I don't want the Layout to become a part of the Project at all - I just want the in-memory Layout object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2020 21:29:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/import-a-layout-from-pagx-without-adding-it-to/m-p/806318#M2192</guid>
      <dc:creator>DavidLaMartina</dc:creator>
      <dc:date>2020-01-10T21:29:15Z</dc:date>
    </item>
  </channel>
</rss>

