<?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: drop down list for model builder in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813857#M1932</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I appreicate the comment and help. I added tehCaculate Value from the Utiliities of ArcPro.&lt;IMG alt="Model" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/400320_model.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also add the code block as. I wanted to use os.path.join to handle it a little more approiately but the tool didn't accept it.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/400321_Capture2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;for the parameters of the userLyr function I used "%LayerFile" which is a string variable in model builder but holds a value list for the user, and the "%layerFilePath%" which is derived from the parse path tool so that I can always retreive the relative path of each layer file where they will be stored. The only issue that I've found is that when running it, the model does not apply the symbology. I am not sure if this is a glitch of the tool or something.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 Apr 2018 13:51:06 GMT</pubDate>
    <dc:creator>ianmcintosh</dc:creator>
    <dc:date>2018-04-01T13:51:06Z</dc:date>
    <item>
      <title>drop down list for model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813855#M1930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was wondering if it is possible to create a drop down list that returns a layer files that the user can select to be used with apply symbology tool in model builder. I've tried to use parse path with string to create a value list, but that does not work. I thought the iterator over files would work but I couldn't make that work. I know this can be accomplished using a python script, but i'd like to do this in model builder. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Mar 2018 15:28:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813855#M1930</guid>
      <dc:creator>ianmcintosh</dc:creator>
      <dc:date>2018-03-31T15:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: drop down list for model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813856#M1931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Model Builder way this is done is to add a model variable of type string (I'll name it 'key'), make it a model parameter, and set up a &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/value-list-filter.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Value list filter&amp;nbsp;of keywords&lt;/A&gt;, which you then can map to a layer file (each layer file included in the model) using the Calculate Value tool. (The r"" business there is required because the&amp;nbsp;layer file model variables include \ characters we need to hide from Python)&lt;/P&gt;&lt;P&gt;Calculate Value tool parameters:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# expression: plyr("%key%",[r"%layerfile 1%",r"%layerfile 2%",r"%layerfile 3%"] )&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# code block:&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;plyr&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;key&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lyrpaths&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; keys &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"BLUE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"YELLOW"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"VIOLET"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# these were in your parameter filter&lt;/SPAN&gt;
&amp;nbsp; lookup &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; dict&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;zip&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;keys&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lyrpaths&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; lookup&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;key&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# data type: layer file‍‍‍‍‍‍‍ (to connect to apply symbology)‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:35:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813856#M1931</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T09:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: drop down list for model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813857#M1932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I appreicate the comment and help. I added tehCaculate Value from the Utiliities of ArcPro.&lt;IMG alt="Model" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/400320_model.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also add the code block as. I wanted to use os.path.join to handle it a little more approiately but the tool didn't accept it.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/400321_Capture2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;for the parameters of the userLyr function I used "%LayerFile" which is a string variable in model builder but holds a value list for the user, and the "%layerFilePath%" which is derived from the parse path tool so that I can always retreive the relative path of each layer file where they will be stored. The only issue that I've found is that when running it, the model does not apply the symbology. I am not sure if this is a glitch of the tool or something.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2018 13:51:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813857#M1932</guid>
      <dc:creator>ianmcintosh</dc:creator>
      <dc:date>2018-04-01T13:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: drop down list for model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813858#M1933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some thoughts:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If you want to use os.path.join, you need to import os in your Calculate Value code block.&lt;/LI&gt;&lt;LI&gt;You should connect the Value element to Calculate Value so you can be certain the value is updated before Calculate Value uses it.&lt;/LI&gt;&lt;LI&gt;As for the tool not "working" I would look carefully at the messages you see when you run the model, you may see some things aren't getting set exactly how you need them to be.&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2018 19:03:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813858#M1933</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2018-04-01T19:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: drop down list for model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813859#M1934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response. I am not sure how connecting the Value element to the Calculate Value works as part of the expression box or code block. The parsed path is used as an inline variable for the Calculate Value tool. Also, when I read the message from the output everything looks fine. &lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/400349_Capture3.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2018 20:50:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813859#M1934</guid>
      <dc:creator>ianmcintosh</dc:creator>
      <dc:date>2018-04-01T20:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: drop down list for model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813860#M1935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Curtis Price,&lt;/P&gt;&lt;P&gt;I very much appreciate your assistance on this. I was able to figure out what I did wrong. I added the output of the Apply Symbology from Layer as a parameter and it finally worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2018 21:47:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813860#M1935</guid>
      <dc:creator>ianmcintosh</dc:creator>
      <dc:date>2018-04-01T21:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: drop down list for model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813861#M1936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;I am not sure how connecting the Value element to the Calculate Value works as part of the expression box or code block.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Here's how preconditions work to make sure tools in the model run in a particular order when they aren't directly connected as tool parameters:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/a-quick-tour-of-using-precondition.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/a-quick-tour-of-using-precondition.htm"&gt;A quick tour of using preconditions—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2018 21:54:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813861#M1936</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2018-04-01T21:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: drop down list for model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813862#M1937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahh - this ensured the output was updated on the display.. that makes sense!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2018 21:56:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/drop-down-list-for-model-builder/m-p/813862#M1937</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2018-04-01T21:56:11Z</dc:date>
    </item>
  </channel>
</rss>

