<?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: Use custom .pyt toolbox in arcpy in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/use-custom-pyt-toolbox-in-arcpy/m-p/1198590#M58095</link>
    <description>&lt;P&gt;ArcPy doesn't automatically know about your custom toolbox, but you can add it with &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/importtoolbox.htm" target="_self"&gt;ImportToolbox&lt;/A&gt;:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;arcpy.ImportToolbox(r"C:\path\to\custom.pyt")&lt;/PRE&gt;&lt;PRE&gt;arcpy.custom.Tool("parameter 1", "parameter 2")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Where `custom` is the alias assigned to the toolbox. The documents within the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/using-tools-in-python.htm" target="_self"&gt;Using tools in Python&lt;/A&gt; section of the help provide details on working with toolboxes from Python that may be of use.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Shaun&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Aug 2022 15:42:55 GMT</pubDate>
    <dc:creator>ShaunWalbridge</dc:creator>
    <dc:date>2022-08-02T15:42:55Z</dc:date>
    <item>
      <title>Use custom .pyt toolbox in arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-custom-pyt-toolbox-in-arcpy/m-p/1198565#M58094</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have&amp;nbsp; created a custom .pyt toolbox in ArcGIS Pro 2.9. I would like to use the created tools in a scripting environment, but unsure how to do this. When I run one of the tools, if I copy the python code it looks something like this:&lt;/P&gt;&lt;P&gt;arcpy.toolboxName,toolName(input,output).&lt;/P&gt;&lt;P&gt;However, if I try to run the script in arcpy, the toolbox is not loaded. How does one get the same functionality that is available within a GUI environment in ArcgisPro?&lt;/P&gt;&lt;P&gt;Even though I can copy and paste the python code, is that kind of pseudo-code that can't actually be used? When I try to cut and paste into a python window within an arcgisPro GUI, it doesn't work.&lt;/P&gt;&lt;P&gt;Just trying to understand python toolboxes and how to get them to play with scripts. It's a little redundant to write scripts and tools separately.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 15:15:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-custom-pyt-toolbox-in-arcpy/m-p/1198565#M58094</guid>
      <dc:creator>WadeWall</dc:creator>
      <dc:date>2022-08-02T15:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Use custom .pyt toolbox in arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-custom-pyt-toolbox-in-arcpy/m-p/1198590#M58095</link>
      <description>&lt;P&gt;ArcPy doesn't automatically know about your custom toolbox, but you can add it with &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/importtoolbox.htm" target="_self"&gt;ImportToolbox&lt;/A&gt;:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;arcpy.ImportToolbox(r"C:\path\to\custom.pyt")&lt;/PRE&gt;&lt;PRE&gt;arcpy.custom.Tool("parameter 1", "parameter 2")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Where `custom` is the alias assigned to the toolbox. The documents within the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/using-tools-in-python.htm" target="_self"&gt;Using tools in Python&lt;/A&gt; section of the help provide details on working with toolboxes from Python that may be of use.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Shaun&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 15:42:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-custom-pyt-toolbox-in-arcpy/m-p/1198590#M58095</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2022-08-02T15:42:55Z</dc:date>
    </item>
  </channel>
</rss>

