<?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: Model Builder Parameters: Restrict input layer choice to a subset of layers in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279757#M9645</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the following when trying to add the code that you provided when updating the Validation.&amp;nbsp; I am updating the compare_list with only those layers I want to consider in the TOC.&amp;nbsp; Do you have any ideas what may be causing this?&amp;nbsp; Thanks again.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/183122_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Feb 2016 22:15:53 GMT</pubDate>
    <dc:creator>CraigPrisland1</dc:creator>
    <dc:date>2016-02-16T22:15:53Z</dc:date>
    <item>
      <title>Model Builder Parameters: Restrict input layer choice to a subset of layers</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279750#M9638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a model that requires a user to select one of several rasters as a model parameter (input variable). By default, all the rasters in the TOC are available as parameter choices and are accessible in the dialog box for the model through a drop down button. I'd like some of these raster layers to not be available to the model user. How could I restrict the available layer list to a subset?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Michael&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 23:39:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279750#M9638</guid>
      <dc:creator>MWing</dc:creator>
      <dc:date>2010-05-10T23:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Parameters: Restrict input layer choice to a subset of layers</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279751#M9639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is anyone aware if this question was ever answered?&amp;nbsp; Even though it was posted several years ago, I am running into the same issue.&amp;nbsp; However instead of rasters, I'm dealing with feature classes.&amp;nbsp; I can filter the dropdown selection in the parameter by feature class type but am looking to filter this dropdown to specific feature class names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 18:36:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279751#M9639</guid>
      <dc:creator>CraigPrisland1</dc:creator>
      <dc:date>2016-02-12T18:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Parameters: Restrict input layer choice to a subset of layers</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279752#M9640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you know the names in the layer list beforehand? If so, you can populate a string parameter &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Value_list_filter/002w00000042000000/"&gt;value list&lt;/A&gt; with the names of your layers, and reference them in your model through &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002w0000001t000000"&gt;inline variable substitution&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 18:43:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279752#M9640</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-02-12T18:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Parameters: Restrict input layer choice to a subset of layers</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279753#M9641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That works well as I will know the names of the layers.&amp;nbsp; The only issue that I have with this process is that it is possible that not all layers will be in the TOC and I do not want layers not in the TOC available in the dropdown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 19:02:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279753#M9641</guid>
      <dc:creator>CraigPrisland1</dc:creator>
      <dc:date>2016-02-12T19:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Parameters: Restrict input layer choice to a subset of layers</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279754#M9642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure how you can achieve this in Model Builder, but once you're model is completely finished, you can export it to a Python script, create a &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/a-quick-tour-of-creating-script-tools.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;script tool&lt;/A&gt;, and use &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/customizing-script-tool-behavior.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;validation &lt;/A&gt;to customize the filter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; def initializeParameters(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """Refine the properties of a tool's parameters.&amp;nbsp; This method is
&amp;nbsp;&amp;nbsp;&amp;nbsp; called when the tool is opened."""
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument("CURRENT")
&amp;nbsp;&amp;nbsp;&amp;nbsp; lyrs = arcpy.mapping.ListLayers(mxd)
&amp;nbsp;&amp;nbsp;&amp;nbsp; compare_list = ['points','buff','something_else'] # the full list of layers you want to consider
&amp;nbsp;&amp;nbsp;&amp;nbsp; param_list = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; for lyr in lyrs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.name in compare_list:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param_list.append(lyr.name) # add to internal list
&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].filter.list = param_list # overwrite filter list
&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:35:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279754#M9642</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T13:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Parameters: Restrict input layer choice to a subset of layers</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279755#M9643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Darren.&amp;nbsp; One quick question:&amp;nbsp; Would you keep the string parameter value list and inline variable substitution in the model when you export it to Python?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 16:22:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279755#M9643</guid>
      <dc:creator>CraigPrisland1</dc:creator>
      <dc:date>2016-02-15T16:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Parameters: Restrict input layer choice to a subset of layers</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279756#M9644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically, yes. You can't (I don't think) change the parameter to a more appropriate type like Feature Class or Feature Layer because there will only be a Feature Class filter available, not Value List. Once you're more familiar with Python, you can clean up the exported code to change the inline variable substitution to more readable variables, but for now it should be fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 17:59:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279756#M9644</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-02-15T17:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Parameters: Restrict input layer choice to a subset of layers</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279757#M9645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the following when trying to add the code that you provided when updating the Validation.&amp;nbsp; I am updating the compare_list with only those layers I want to consider in the TOC.&amp;nbsp; Do you have any ideas what may be causing this?&amp;nbsp; Thanks again.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/183122_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 22:15:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279757#M9645</guid>
      <dc:creator>CraigPrisland1</dc:creator>
      <dc:date>2016-02-16T22:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Parameters: Restrict input layer choice to a subset of layers</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279758#M9646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, you'll have to adjust the index number for self.params[] to match your interface. In my example, I specified self.params[2] to mean the third parameter. The counting starts at zero. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 00:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279758#M9646</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-02-17T00:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Parameters: Restrict input layer choice to a subset of layers</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279759#M9647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for all of your assistance Darren.&amp;nbsp; This is exactly what I needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 16:26:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-parameters-restrict-input-layer/m-p/279759#M9647</guid>
      <dc:creator>CraigPrisland1</dc:creator>
      <dc:date>2016-02-17T16:26:58Z</dc:date>
    </item>
  </channel>
</rss>

