<?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: Turning code into a script and parameterizing? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397381#M31375</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Comments...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Why the command line image?&lt;/LI&gt;&lt;LI&gt;Use relative paths?&lt;/LI&gt;&lt;LI&gt;You have to run the script from within the toolbox... either add the layer to arcmap ( so you can select it) OR navigate to it on disk.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 22 Aug 2015 00:16:18 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2015-08-22T00:16:18Z</dc:date>
    <item>
      <title>Turning code into a script and parameterizing?</title>
      <link>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397373#M31367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;I have python code that I want to turn into a script.&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;I want the end user to be able to navigate to the feature class the code should be run on.&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;The code I have currently speaks to a specific feature class and doesn't allow for picking what feature class the code is to be run on.&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;How do I change my code so I can have the parameters in the script allow the end user to pick what feature class the code should be run on?&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;This is the piece of code I need to change to allow the end user pick the feature class.. &lt;A href="http://i.stack.imgur.com/ZiZRQ.png" rel="nofollow" style="color: #358daa;"&gt;&lt;IMG alt="enter image description here" class="jive-image" src="http://i.stack.imgur.com/ZiZRQ.png" style="border: 0px;" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;What do I need to change in my code to allow for the peramiters I set up in the script to replace this line of code? I need fc to equal the input the end user selects not a specific feature class as the code currently stands.&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;I changed that line of code to &lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;fc &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;GetParameterAsText&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit" style="color: #800000;"&gt;0&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; and set up parameters in my script dialogue but it errors out on me every time.&amp;nbsp; Code works fine w/out the "getparametersastext" addition mentioned above.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 15:49:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397373#M31367</guid>
      <dc:creator>TravisLathrop1</dc:creator>
      <dc:date>2015-08-21T15:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Turning code into a script and parameterizing?</title>
      <link>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397374#M31368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are you wanting your user to execute your code? Do you want them to execute it via a Script tool within the ArcGIS Desktop application? Are you wanting them to paste your code into the python window? Are you wanting to execute it standalone from a DOS prompt or python IDE?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 16:13:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397374#M31368</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2015-08-21T16:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Turning code into a script and parameterizing?</title>
      <link>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397375#M31369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your tying your script to a tool box its pretty simple &lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00150000001r000000.htm" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00150000001r000000.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 17:53:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397375#M31369</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-08-21T17:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Turning code into a script and parameterizing?</title>
      <link>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397376#M31370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wes...&amp;nbsp; you can't use 10.2 links...they go nowhere...it is a known bug, there is a workaround but use 10.3.1 links since (unless there is a difference) they are largely the same. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 18:14:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397376#M31370</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-08-21T18:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Turning code into a script and parameterizing?</title>
      <link>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397377#M31371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/people/Dan_Patterson"&gt;Dan Patterson&lt;/A&gt; how do i find 10.3.1 links i searched "add python script to toolbox 10.3.1" but it doesn't return any results for 10.3.1 I'm using IE10&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 18:21:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397377#M31371</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-08-21T18:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Turning code into a script and parameterizing?</title>
      <link>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397378#M31372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The top level help for Python in 10.3 is ​&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/python/what-is-python-.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/python/what-is-python-.htm"&gt;http://desktop.arcgis.com/en/desktop/latest/analyze/python/what-is-python-.htm&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tools in Toolboxes is discussed &lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/adding-a-script-tool.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/adding-a-script-tool.htm"&gt;Adding a script tool—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Travis, can you give a snapshot of how you have the dialog box setup?&amp;nbsp; also, what is the error you are getting?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 19:15:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397378#M31372</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2015-08-21T19:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Turning code into a script and parameterizing?</title>
      <link>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397379#M31373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 19:17:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397379#M31373</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-08-21T19:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Turning code into a script and parameterizing?</title>
      <link>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397380#M31374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rebecca thanks for the feedback....below are two snap shots my my dialog box set up.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;IMG alt="Parameters.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/123373_Parameters.png" style="height: auto;" /&gt;&lt;IMG alt="Genearl.png" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/123374_Genearl.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 20:58:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397380#M31374</guid>
      <dc:creator>TravisLathrop1</dc:creator>
      <dc:date>2015-08-21T20:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Turning code into a script and parameterizing?</title>
      <link>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397381#M31375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Comments...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Why the command line image?&lt;/LI&gt;&lt;LI&gt;Use relative paths?&lt;/LI&gt;&lt;LI&gt;You have to run the script from within the toolbox... either add the layer to arcmap ( so you can select it) OR navigate to it on disk.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2015 00:16:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397381#M31375</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-08-22T00:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Turning code into a script and parameterizing?</title>
      <link>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397382#M31376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apparently I had a bug in ArcMap. I had to reinstall the software and once I did that the script worked fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 14:33:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turning-code-into-a-script-and-parameterizing/m-p/397382#M31376</guid>
      <dc:creator>TravisLathrop1</dc:creator>
      <dc:date>2015-08-28T14:33:56Z</dc:date>
    </item>
  </channel>
</rss>

