<?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: How to disable a parameter in Python script tool window? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-disable-a-parameter-in-python-script-tool/m-p/122537#M9519</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Russell, I passed over the validation section!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Jul 2014 15:29:44 GMT</pubDate>
    <dc:creator>MarAlcaraz</dc:creator>
    <dc:date>2014-07-30T15:29:44Z</dc:date>
    <item>
      <title>How to disable a parameter in Python script tool window?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-disable-a-parameter-in-python-script-tool/m-p/122535#M9517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to offer to final users of a python script tool the option to work with a constant value (as double) or a raster dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've thought about defining 2 parameters ( double and raster dataset) but I dont know how to disable the parameter not selected by the user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that possible? Is there other solutions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 16:46:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-disable-a-parameter-in-python-script-tool/m-p/122535#M9517</guid>
      <dc:creator>MarAlcaraz</dc:creator>
      <dc:date>2014-07-29T16:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to disable a parameter in Python script tool window?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-disable-a-parameter-in-python-script-tool/m-p/122536#M9518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at this topic, it describes how to perform the validation you are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Customizing_script_tool_behavior/00150000000t000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/Customizing_script_tool_behavior/00150000000t000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;Customizing Script tool behavior&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first example on this page shows you what you need to do in the updateParameters method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="k" style="color: #0000ff;"&gt;def&lt;/SPAN&gt; &lt;SPAN class="nf"&gt;updateParameters&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="bp"&gt;self&lt;/SPAN&gt;&lt;SPAN class="p"&gt;):&lt;/SPAN&gt;

&amp;nbsp; &lt;SPAN class="c" style="color: #008000;"&gt;# If the option to use a weights file is selected (the user chose&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="c" style="color: #008000;"&gt;# "Get Spatial Weights From File"), enable the parameter for specifying &lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="c" style="color: #008000;"&gt;# the file, otherwise disable it&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="c" style="color: #008000;"&gt;#&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="k" style="color: #0000ff;"&gt;if&lt;/SPAN&gt; &lt;SPAN class="bp"&gt;self&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;params&lt;/SPAN&gt;&lt;SPAN class="p"&gt;[&lt;/SPAN&gt;&lt;SPAN class="mi" style="color: #666666;"&gt;3&lt;/SPAN&gt;&lt;SPAN class="p"&gt;]&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;value&lt;/SPAN&gt; &lt;SPAN class="o"&gt;==&lt;/SPAN&gt; &lt;SPAN class="s" style="color: #a31515;"&gt;"Get Spatial Weights From File"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="bp"&gt;self&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;params&lt;/SPAN&gt;&lt;SPAN class="p"&gt;[&lt;/SPAN&gt;&lt;SPAN class="mi" style="color: #666666;"&gt;8&lt;/SPAN&gt;&lt;SPAN class="p"&gt;]&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;enabled&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="mi" style="color: #666666;"&gt;1&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="k" style="color: #0000ff;"&gt;else&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="bp"&gt;self&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;params&lt;/SPAN&gt;&lt;SPAN class="p"&gt;[&lt;/SPAN&gt;&lt;SPAN class="mi" style="color: #666666;"&gt;8&lt;/SPAN&gt;&lt;SPAN class="p"&gt;]&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;enabled&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="mi" style="color: #666666;"&gt;0&lt;/SPAN&gt;&lt;/CODE&gt;




&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will want to change this slightly for your workflow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:03:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-disable-a-parameter-in-python-script-tool/m-p/122536#M9518</guid>
      <dc:creator>RussellBrennan</dc:creator>
      <dc:date>2021-12-11T07:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to disable a parameter in Python script tool window?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-disable-a-parameter-in-python-script-tool/m-p/122537#M9519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Russell, I passed over the validation section!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 15:29:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-disable-a-parameter-in-python-script-tool/m-p/122537#M9519</guid>
      <dc:creator>MarAlcaraz</dc:creator>
      <dc:date>2014-07-30T15:29:44Z</dc:date>
    </item>
  </channel>
</rss>

