<?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: Setting Script Tool Parameters - Python in ModelBuilder in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106770#M8257</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No I have not seen this behavior. I'm wondering if there is a logic thing going on here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The raw strings are only needed when you are passing a model variable&amp;nbsp; that is a path (like a dataset path) into the function used by Calculate Value. The r is needed to ensure the backslashes are always interpreted as path delimeters instead of part of an escape sequence (for example so "path\temp" isn't intepretes as "path" + &amp;lt;tab&amp;gt; + "emp").&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 May 2015 03:07:59 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2015-05-15T03:07:59Z</dc:date>
    <item>
      <title>Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106760#M8247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering if you could help with following. Essentially it relates to the following help article "Setting Script Tool Parameters" &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00150000000n000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//00150000000n000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a used ModelBuilder to create a geoprocessing workflow. However for part of this I need to run a script within the model to dissolve some features within a layer (the inbuilt modelbuilder geoprocessing function for this does not give me multi-part polygons, despite this being a supposed option).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance (Using ArcGIS 10.2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Essentially the problem I encounter is that when I run the model ArcGIS goes in to 'not responding mode' and does not recover. I suspect there is something wrong with wither my python script or the way I am passing variables between modelbuilder and my python script?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Python Script - Dissolve2&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = "C:/Data/ArcGIS/Default.gdb/Dissolve1"&lt;/P&gt;&lt;P&gt;inLayer = arcpy.GetParameter(0)&lt;/P&gt;&lt;P&gt;outLayer = "C:/Data/ArcGIS/temp/OutDisolve.shp"&lt;/P&gt;&lt;P&gt;arcpy.Dissolve_management(inLayer, outLayer, "Id", "","MULTI_PART", "")&lt;/P&gt;&lt;P&gt;arcpy.SetParameter(1, OutLayer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have provided screenshots below&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. A simplified view of the model&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Model.JPG" class="image-1 jive-image" height="147" src="https://community.esri.com/legacyfs/online/98028_Model.JPG" style="width: 452px; height: 146.731px;" width="452" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="InLayer.JPG" class="image-4 jive-image" height="404" src="https://community.esri.com/legacyfs/online/98031_InLayer.JPG" style="height: 404px; width: 309.154px;" width="309" /&gt;&lt;IMG alt="OutLayer.JPG" class="image-5 jive-image" height="404" src="https://community.esri.com/legacyfs/online/98032_OutLayer.JPG" style="width: 311px; height: 404.009px;" width="311" /&gt;&lt;/P&gt;&lt;P&gt;2. Parameter Input and Output&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 07:35:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106760#M8247</guid>
      <dc:creator>NickBauer</dc:creator>
      <dc:date>2015-05-11T07:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106761#M8248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does the Model freeze up with this particular dataset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 16:04:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106761#M8248</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2015-05-11T16:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106762#M8249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the capitalization of outLayer vs. OutLayer. These are two different things according to Python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1431362753698679 jive_text_macro" data-renderedposition="71_8_912_16" jivemacro_uid="_1431362753698679"&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;arcpy.SetParameter(1, outLayer)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 16:45:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106762#M8249</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-05-11T16:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106763#M8250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;&amp;gt; &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;(the inbuilt modelbuilder geoprocessing function for this does not give me multi-part polygons, despite this being a supposed option).&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I'm kind of confused by this because the Dissolve tool is the same tool, whether called from ModelBuilder, a Python script, or run from a toolbox in ArcMap interactively.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Another option to the overhead of setting up a script tool is to use the Calculate Value tool in ModelBuilder. Especially handy for situations where the logic of ModelBuilder validations and preconditions get complicated or problematic, but you don't want to bother with a python script tool.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;EM&gt;Expression&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;proc(r"%InLayer%", r"%OutName%")&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;EM&gt;Code Block&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;import os&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;import arcpy&lt;/SPAN&gt;
def&amp;nbsp; proc(lyr, outname):
&amp;nbsp; output = os.path.join(
&amp;nbsp;&amp;nbsp;&amp;nbsp; os.path.dirname(arcpy.Describe(lyr).catalogPath),
&amp;nbsp;&amp;nbsp;&amp;nbsp; outname)
&amp;nbsp; arcpy.Dissolve_management(lyr, output)
&amp;nbsp; return output&lt;/PRE&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;EM&gt;Data Type:&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Feature Class&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:29:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106763#M8250</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T06:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106764#M8251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure if it will help but you may want to try changing arcpy.GetParameter(0) to arcpy.GetParameterAsText(0). If that doesn't help you may want to use a &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; code&lt;/P&gt;&lt;P&gt;except arcpy.ExecuteError:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg = arcpy.GetMessage(0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError(msgs)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might show what's going wrong. If not, you could import os and traceback and write a more detailed "except" to catch other python errors. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 13:14:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106764#M8251</guid>
      <dc:creator>JohnBrodnicki</dc:creator>
      <dc:date>2015-05-12T13:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106765#M8252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GetParameterAsText and SetParameterAsText should always be used unless you have a good reason to use the GetParameter and SetParameter functions. The GP environment is really setup to move data around as strings (think XML) and generally you'll be happier just going with that flow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for trapping exceptions and traceback - always a great idea. There are some nice code samples in the help here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/python/error-handling-with-python.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/python/error-handling-with-python.htm"&gt;Error handling with Python—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 01:01:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106765#M8252</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-05-13T01:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106766#M8253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Freddie,&lt;/P&gt;&lt;P&gt;No I have tried with several different and simplified datasets and this does not help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 02:23:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106766#M8253</guid>
      <dc:creator>NickBauer</dc:creator>
      <dc:date>2015-05-13T02:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106767#M8254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks picking this up Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried this but it does not seem to be the source of my issue. I am still trying to solve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 23:25:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106767#M8254</guid>
      <dc:creator>NickBauer1</dc:creator>
      <dc:date>2015-05-14T23:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106768#M8255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Curtis, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is definitely helping me eliminate some issues, but I am still trying to get to the bottom of the issue I am having.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 23:27:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106768#M8255</guid>
      <dc:creator>NickBauer1</dc:creator>
      <dc:date>2015-05-14T23:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106769#M8256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Curtis Price wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;gt; &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;(the inbuilt modelbuilder geoprocessing function for this does not give me multi-part polygons, despite this being a supposed option).&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I'm kind of confused by this because the Dissolve tool is the same tool, whether called from ModelBuilder, a Python script, or run from a toolbox in ArcMap interactively.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi Curtis, yes I agree that the underlying tools are (should) be the same... but when I put the dissolve action into modelbuilder I can't seem to get it make multi-polygons (only single-part), despite this being an obvious option to specify? Is this your experience?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regards to the "Calculate Value Tool" should the expression have an&lt;STRONG&gt; r before %OutName%? &lt;/STRONG&gt;This does seem like a more simple way to go. Do you know of any other examples I can follow?&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Thanks&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 23:37:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106769#M8256</guid>
      <dc:creator>NickBauer1</dc:creator>
      <dc:date>2015-05-14T23:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106770#M8257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No I have not seen this behavior. I'm wondering if there is a logic thing going on here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The raw strings are only needed when you are passing a model variable&amp;nbsp; that is a path (like a dataset path) into the function used by Calculate Value. The r is needed to ensure the backslashes are always interpreted as path delimeters instead of part of an escape sequence (for example so "path\temp" isn't intepretes as "path" + &amp;lt;tab&amp;gt; + "emp").&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 03:07:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106770#M8257</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-05-15T03:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106771#M8258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your workspace is set as a folder inside of a file geodatabase,&lt;/P&gt;&lt;P&gt;Your output layer is specifying an output shapefile. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data type is incompatible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;arcpy.env.workspace = "C:/Data/ArcGIS/Default.gdb/"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;outLayer = "C:/Data/ArcGIS/temp/OutDisolve"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Susan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 03:36:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106771#M8258</guid>
      <dc:creator>SusanJones</dc:creator>
      <dc:date>2015-05-15T03:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106772#M8259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Your workspace is set as a folder inside of a file geodatabase,&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Your output layer is specifying an output shapefile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;The data type is incompatible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Try&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;arcpy.env.workspace = "C:/Data/ArcGIS/Default.gdb/"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Replace&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;outLayer = "OutDisolve"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;Susan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 03:41:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106772#M8259</guid>
      <dc:creator>SusanJones</dc:creator>
      <dc:date>2015-05-15T03:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106773#M8260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you checked the "id" field to ensure there are multiple matching values in that field?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 01:17:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106773#M8260</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-05-26T01:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106774#M8261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first thing I noticed is that your workspace is set to a feature class inside a gdb, as Susan is saying. The workspace should be either a GDB or a folder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 02:14:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106774#M8261</guid>
      <dc:creator>SepheFox</dc:creator>
      <dc:date>2015-05-26T02:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106775#M8262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to make sure it's clear for the good of the thread:&lt;/P&gt;&lt;P&gt;A workspace can be a folder, a geodatabase, or a feature dataset (within a geodatabase). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 16:06:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106775#M8262</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-05-26T16:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106776#M8263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, I didn't know it could be a dataset, so thanks for that info, but what Nick's trying to use is not clear, since his script tool dialog says the input is a shapefile, so I would think he would want his workspace to be a folder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 16:18:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106776#M8263</guid>
      <dc:creator>SepheFox</dc:creator>
      <dc:date>2015-05-26T16:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106777#M8264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should work as the current workspace does not come into play when complete paths are provided. In fact I don't see a reason to set the workspace at all in his model. (It is a simplified model he kindly provided, so there is probably more going on we don't know about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would avoid setting workspaces to be feature datasets unless there was a reason (ie making the code easier to read when processing data within a feature dataset. I could imagine there may be some bugs he may run into.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 16:31:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106777#M8264</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-05-26T16:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Script Tool Parameters - Python in ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106778#M8265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a demo of Curtis' point. The workspace environment is only used when it hasn't been overridden by a full path:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = r'C:\junk\File_GDB.gdb'
&amp;gt;&amp;gt;&amp;gt; out_shape = r'C:\junk\out_shape.shp'
&amp;gt;&amp;gt;&amp;gt; in_shape = r'C:\junk\points.shp'
&amp;gt;&amp;gt;&amp;gt; arcpy.Buffer_analysis(in_shape,out_shape,"50 METERS")
&amp;lt;Result 'C:\\junk\\out_shape.shp'&amp;gt;
&amp;gt;&amp;gt;&amp;gt; arcpy.Buffer_analysis(in_shape,'buffer',"50 METERS")
&amp;lt;Result 'C:\\junk\\FILE_GDB.gdb\\buffer'&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:29:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-script-tool-parameters-python-in/m-p/106778#M8265</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T06:29:05Z</dc:date>
    </item>
  </channel>
</rss>

