<?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 LayerFactory.Instance.CreateLayer() to NOT to add layer in Table or Content in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876572#M5436</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;STRONG style="background-color: transparent; color: #000000; text-decoration: none; font-size: 11pt;"&gt;I would like to load the lyrx file in memory (i.e. without loading it on screen) in ArcGIS Pro&lt;/STRONG&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt; and use it to do an intersect (or a spatial search) with a layer that is already loaded in Pro. &amp;nbsp;Is that possible? We used to do that in ArcMap / ArcObjects where we read the lyr file into a ILayer object. &amp;nbsp;This ILayer object is only in memory, not on the ArcMap screen.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;In Pro, we can call LayerFactory.Instance.CreateLayer() to create a Layer object from a lyr file, but the layer will be loaded on screen.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 10pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;Uri uri = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: #0000ff; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt; Uri(sTempLayerFilePath);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 10pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;pLayer = LayerFactory.Instance.CreateLayer(uri, _pMap); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Do you have plan to give option to CreateLayer() not loading layer into Table of Content?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Sep 2018 21:24:31 GMT</pubDate>
    <dc:creator>joonpark</dc:creator>
    <dc:date>2018-09-11T21:24:31Z</dc:date>
    <item>
      <title>LayerFactory.Instance.CreateLayer() to NOT to add layer in Table or Content</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876572#M5436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;STRONG style="background-color: transparent; color: #000000; text-decoration: none; font-size: 11pt;"&gt;I would like to load the lyrx file in memory (i.e. without loading it on screen) in ArcGIS Pro&lt;/STRONG&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt; and use it to do an intersect (or a spatial search) with a layer that is already loaded in Pro. &amp;nbsp;Is that possible? We used to do that in ArcMap / ArcObjects where we read the lyr file into a ILayer object. &amp;nbsp;This ILayer object is only in memory, not on the ArcMap screen.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;In Pro, we can call LayerFactory.Instance.CreateLayer() to create a Layer object from a lyr file, but the layer will be loaded on screen.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 10pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;Uri uri = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: #0000ff; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt; Uri(sTempLayerFilePath);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 10pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;pLayer = LayerFactory.Instance.CreateLayer(uri, _pMap); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Do you have plan to give option to CreateLayer() not loading layer into Table of Content?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2018 21:24:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876572#M5436</guid>
      <dc:creator>joonpark</dc:creator>
      <dc:date>2018-09-11T21:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: LayerFactory.Instance.CreateLayer() to NOT to add layer in Table or Content</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876573#M5437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joon,&lt;/P&gt;&lt;P&gt;If you use geoprocessing for your operation you do not need to create layer. Use Geoprocessing.MakeValueArray to construct parameters list. All parameters of Geoprocessing.MakeValueArray are object type so you can put featurelayer, featureclass or string path to your feature class. It will recognize automatically parameter type and will read required information.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2018 14:59:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876573#M5437</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2018-09-12T14:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: LayerFactory.Instance.CreateLayer() to NOT to add layer in Table or Content</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876574#M5438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But, isn't true that, even if I use geoprocessing to run the&amp;nbsp;intersect, I need to load the output feature class and read the intersect results?&amp;nbsp; That means the output layer will be seen on screen in Pro.&amp;nbsp; &amp;nbsp;But, in the ArcObjects world, I can do an intersect and read the results via ILayer, IFeatureCursor, and IFeature, without loading anything on screen in ArcMap.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2018 16:35:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876574#M5438</guid>
      <dc:creator>VivienWong</dc:creator>
      <dc:date>2018-09-12T16:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: LayerFactory.Instance.CreateLayer() to NOT to add layer in Table or Content</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876575#M5439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;ArcGIS Pro geoprocessing has the same feature as ArcObjects does. Do not use flags &lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 9.5pt;"&gt;GPExecuteToolFlags.AddOutputsToMap &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 9.5pt;"&gt; GPExecuteToolFlags.Default &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;and geoprocessing results will not be added&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;to map. More information here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geoprocessing"&gt;&lt;SPAN style="color: #3778c7; text-decoration: underline;"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geoprocessing&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2018 05:38:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876575#M5439</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2018-09-13T05:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: LayerFactory.Instance.CreateLayer() to NOT to add layer in Table or Content</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876576#M5440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without adding the layer to the Pro screen, how do you read the intersect results?&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2018 16:20:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876576#M5440</guid>
      <dc:creator>VivienWong</dc:creator>
      <dc:date>2018-09-13T16:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: LayerFactory.Instance.CreateLayer() to NOT to add layer in Table or Content</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876577#M5441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vivien,&lt;/P&gt;&lt;P&gt;You must set output path of your results. I do not know which exactly geoprocessing tool you are going to use,&amp;nbsp; but I will show you on Spatial Analyst Raster Calculator example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;private&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;static&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;bool&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; ExecuteRasterCalculator(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; sExpression, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; sOutRaster, Envelope pExtent, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; sWorkspace, &lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; sMaskRaster)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;try&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; gpresult1 = Task.Run(() =&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; parameters = Geoprocessing.MakeValueArray(sExpression, sOutRaster);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IReadOnlyList&amp;lt;KeyValuePair&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&amp;gt;&amp;gt; environments;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;environments = Geoprocessing.MakeEnvironmentArray(mask: sMaskRaster, extent: pExtent, workspace: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sWorkspace);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; Geoprocessing.ExecuteToolAsync(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"RasterCalculator_sa"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;, parameters, environments,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CancelableProgressor.None, GPExecuteToolFlags.AddToHistory);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; !gpresult1.Result.IsFailed;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;catch&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (Exception ex)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result raster will be stored on path &lt;SPAN style="font-family: Consolas; font-size: small;"&gt;sOutRaster&lt;/SPAN&gt;. &lt;SPAN style="font-family: Consolas; font-size: small;"&gt;Geoprocessing.MakeValueArray&lt;/SPAN&gt; parameters count and sequence depends on geoprocessing tool. For order and parameters look into your tool description&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2018 07:40:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/layerfactory-instance-createlayer-to-not-to-add/m-p/876577#M5441</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2018-09-14T07:40:42Z</dc:date>
    </item>
  </channel>
</rss>

