<?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: ArcPy - How do I run custom script tools within the console? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334276#M26064</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That makes sense, thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jan 2018 19:21:07 GMT</pubDate>
    <dc:creator>MarcusSanders2</dc:creator>
    <dc:date>2018-01-12T19:21:07Z</dc:date>
    <item>
      <title>ArcPy - How do I run custom script tools within the console?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334270#M26058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example, I have a custom tool "wellTabletoFC". When I pull up the Item Description, it gives me a syntax as if it can be used within the console:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;wellTabletoFC&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Input_Table&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I drag the script into the Python window, I get this code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;wellTabletoFC&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
Runtime error 
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; File &lt;SPAN class="string token"&gt;"&amp;lt;string&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
AttributeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'module'&lt;/SPAN&gt; object has no attribute &lt;SPAN class="string token"&gt;'wellTabletoFC'&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How do I use my own tools in the same way as ArcGIS tools within ArcPy, for example:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Project_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; in_dataset&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_dataset&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_coor_system&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; transform_method&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;in_coor_system&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;preserve_shape&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;max_deviation&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;vertical&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;)&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;/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;P&gt;&lt;/P&gt;&lt;P&gt;I want to do this for 2 reasons:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Run the tool within the Python console, while being able to return the tool output into a variable,&lt;/LI&gt;&lt;LI&gt;Chain multiple custom tools together that are maintained separately, into a single workflow&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:50:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334270#M26058</guid>
      <dc:creator>MarcusSanders2</dc:creator>
      <dc:date>2021-12-11T15:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy - How do I run custom script tools within the console?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334271#M26059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is it a script? (aka module) in a location that is within your import path?&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; wellTabletoFC&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2018 16:00:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334271#M26059</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-01-12T16:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy - How do I run custom script tools within the console?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334272#M26060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it's a script tool in a toolbox, you can import the toolbox and script tool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/adding-and-removing-toolboxes.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/adding-and-removing-toolboxes.htm"&gt;Adding toolboxes in Python—Geoprocessing and Python | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2018 16:54:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334272#M26060</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2018-01-12T16:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy - How do I run custom script tools within the console?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334273#M26061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just what I was looking for, works perfectly! Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2018 17:03:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334273#M26061</guid>
      <dc:creator>MarcusSanders2</dc:creator>
      <dc:date>2018-01-12T17:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy - How do I run custom script tools within the console?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334274#M26062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This doesn't seem to persist after ArcMap is closed; is this something that only works&amp;nbsp;during that session?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2018 18:57:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334274#M26062</guid>
      <dc:creator>MarcusSanders2</dc:creator>
      <dc:date>2018-01-12T18:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy - How do I run custom script tools within the console?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334275#M26063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, every time you run your script you need to import the toolbox, much like you need to import any modules at runtime as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2018 19:19:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334275#M26063</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2018-01-12T19:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy - How do I run custom script tools within the console?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334276#M26064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That makes sense, thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2018 19:21:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-how-do-i-run-custom-script-tools-within-the/m-p/334276#M26064</guid>
      <dc:creator>MarcusSanders2</dc:creator>
      <dc:date>2018-01-12T19:21:07Z</dc:date>
    </item>
  </channel>
</rss>

