<?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: Call a script from the default toolbox in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/call-a-script-from-the-default-toolbox/m-p/1590447#M73828</link>
    <description>&lt;P&gt;I think you need to specify an alias for the toolbox on the fly, or set the alias beforehand in the tbx.&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.finaldraftmapping.com/how-to-use-custom-tools-in-a-python-script-with-arcpy/" target="_blank" rel="noopener"&gt;https://learn.finaldraftmapping.com/how-to-use-custom-tools-in-a-python-script-with-arcpy/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

aprx = arcpy.mp.ArcGISProject("CURRENT")

#import toolbox with alias 'default_toolbox'
arcpy.ImportToolbox(aprx.defaultToolbox, 'default_toolbox')                     

#run SE4()
arcpy.default_toolbox.SE4Polygons()                       &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2025 00:06:56 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2025-02-28T00:06:56Z</dc:date>
    <item>
      <title>Call a script from the default toolbox</title>
      <link>https://community.esri.com/t5/python-questions/call-a-script-from-the-default-toolbox/m-p/1590434#M73826</link>
      <description>&lt;P&gt;Is there any way to call a script using the project's default toolbox parameter?&lt;BR /&gt;What works:&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;arcpy.ImportToolbox(path + r"\ArcGIS_Pro.atbx")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;arcpy.ArcGISProatbx.SE4Polygons()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;What I would like to do:&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;arcpy.ImportToolbox(project.defaultToolbox)&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #this part is ok&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;mytools = arcpy.ImportToolbox(project.defaultToolbox)&lt;/FONT&gt;&amp;nbsp; #this is ok too&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;arcpy.project.defaultToolbox.SE4Polygons()&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # doesn't work&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;arcpy.mytools.SE4Polygons()&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; # doesn't work&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 23:38:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/call-a-script-from-the-default-toolbox/m-p/1590434#M73826</guid>
      <dc:creator>DanCrawford</dc:creator>
      <dc:date>2025-02-27T23:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Call a script from the default toolbox</title>
      <link>https://community.esri.com/t5/python-questions/call-a-script-from-the-default-toolbox/m-p/1590443#M73827</link>
      <description>&lt;P&gt;arcpy.ImportToolbox(project.defaultToolboxk, "mytools")&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;arcpy.SE4Polygons_mytools(....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;based on suggestions in...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/adding-and-removing-toolboxes.htm" target="_blank"&gt;Add toolboxes in Python—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 00:01:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/call-a-script-from-the-default-toolbox/m-p/1590443#M73827</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2025-02-28T00:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Call a script from the default toolbox</title>
      <link>https://community.esri.com/t5/python-questions/call-a-script-from-the-default-toolbox/m-p/1590447#M73828</link>
      <description>&lt;P&gt;I think you need to specify an alias for the toolbox on the fly, or set the alias beforehand in the tbx.&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.finaldraftmapping.com/how-to-use-custom-tools-in-a-python-script-with-arcpy/" target="_blank" rel="noopener"&gt;https://learn.finaldraftmapping.com/how-to-use-custom-tools-in-a-python-script-with-arcpy/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

aprx = arcpy.mp.ArcGISProject("CURRENT")

#import toolbox with alias 'default_toolbox'
arcpy.ImportToolbox(aprx.defaultToolbox, 'default_toolbox')                     

#run SE4()
arcpy.default_toolbox.SE4Polygons()                       &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 00:06:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/call-a-script-from-the-default-toolbox/m-p/1590447#M73828</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2025-02-28T00:06:56Z</dc:date>
    </item>
  </channel>
</rss>

