<?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: Importing models from a toolbox toolset in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/importing-models-from-a-toolbox-toolset/m-p/545557#M42549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Last week I finally solved this problem and I thought I'd post the answer here for future reference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After sending this question to the ESRI helpdesk I got the confirmation that it was possible to use tools in a toolset and after some more trying and searching I found the problem, I made an error with the toolname. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When you open the tool properties there's is a name field and a label field. For importing tools the only field that matters is the name field and it turns out I was looking to the label field in the catalog view. In my case those were nearly identical but the toolname had a "(2)" behind it due to me copying the tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the moral of this story is to watch your Label and Name fields and in case of toolboxes also the Alias field carefully and it should all work like a charm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marc&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Oct 2013 07:26:02 GMT</pubDate>
    <dc:creator>MarcEngelsma1</dc:creator>
    <dc:date>2013-10-02T07:26:02Z</dc:date>
    <item>
      <title>Importing models from a toolbox toolset</title>
      <link>https://community.esri.com/t5/python-questions/importing-models-from-a-toolbox-toolset/m-p/545556#M42548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In arcgis 10 I'm trying to import a model that's located in a custom toolbox with the arcpy.ImportToolbox method. This is working ok as long as the model is located in the toolbox root but once I put the model in a toolset I'm getting an error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;AttributeError: 'module' object has no attribute 'TestModel_Database'&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since models in toolbox need to have unique names I assumed the location in a toolset didn't matter but is there some additional info I need to add to the function? I can't seem to find any reference to importing toolsets on the forums, help sites or internet so any info is appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below I pasted a piece of code I'm using to test importing a model that creates a featureclass and adds a field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy&amp;nbsp; arcpy.env.overwriteOutput =1&amp;nbsp; arcpy.ImportToolbox(r"S:\GEOINFO\11_Peilgegevens\PeildataVerwerken")&amp;nbsp; Parameter01 = "xxTest" Parameter02 = "Testfield"&amp;nbsp; arcpy.TestModel_Database(Parameter01, Parameter02)&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As a bonus question, we're going to upgrade to Arcgis 10. or 10.2 in a couple of months, is this method changing in higher versions? I found a lot of references to python toolboxes so I'm just wondering.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers and thanks in advance for any advice,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marc&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 08:06:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importing-models-from-a-toolbox-toolset/m-p/545556#M42548</guid>
      <dc:creator>MarcEngelsma1</dc:creator>
      <dc:date>2013-08-21T08:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Importing models from a toolbox toolset</title>
      <link>https://community.esri.com/t5/python-questions/importing-models-from-a-toolbox-toolset/m-p/545557#M42549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Last week I finally solved this problem and I thought I'd post the answer here for future reference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After sending this question to the ESRI helpdesk I got the confirmation that it was possible to use tools in a toolset and after some more trying and searching I found the problem, I made an error with the toolname. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When you open the tool properties there's is a name field and a label field. For importing tools the only field that matters is the name field and it turns out I was looking to the label field in the catalog view. In my case those were nearly identical but the toolname had a "(2)" behind it due to me copying the tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the moral of this story is to watch your Label and Name fields and in case of toolboxes also the Alias field carefully and it should all work like a charm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marc&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 07:26:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importing-models-from-a-toolbox-toolset/m-p/545557#M42549</guid>
      <dc:creator>MarcEngelsma1</dc:creator>
      <dc:date>2013-10-02T07:26:02Z</dc:date>
    </item>
  </channel>
</rss>

