<?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 Python Script in Model Builder in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-in-model-builder/m-p/488675#M38191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a model builder that creates a MobileCache (using the Mobile Tool) and a python script that empties the MobileCache folder.&amp;nbsp; I want the script to run first, then the Mobile Tool, but I can't seem to find a way. Using a precondition does not work.&amp;nbsp; I'm using ArcGIS 10.0.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jun 2014 16:48:59 GMT</pubDate>
    <dc:creator>DaveCouture</dc:creator>
    <dc:date>2014-06-04T16:48:59Z</dc:date>
    <item>
      <title>Python Script in Model Builder</title>
      <link>https://community.esri.com/t5/python-questions/python-script-in-model-builder/m-p/488675#M38191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a model builder that creates a MobileCache (using the Mobile Tool) and a python script that empties the MobileCache folder.&amp;nbsp; I want the script to run first, then the Mobile Tool, but I can't seem to find a way. Using a precondition does not work.&amp;nbsp; I'm using ArcGIS 10.0.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 16:48:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-in-model-builder/m-p/488675#M38191</guid>
      <dc:creator>DaveCouture</dc:creator>
      <dc:date>2014-06-04T16:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script in Model Builder</title>
      <link>https://community.esri.com/t5/python-questions/python-script-in-model-builder/m-p/488676#M38192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave,&lt;/P&gt;&lt;P&gt;I think I found an answer for you (sorry for the late reply). I had the same issue and found a 2004 entry by Ghislain Prince in the ARCHIVE FORUMS. Here's the thread: &lt;A href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=1728&amp;amp;t=127464&amp;amp;mc=6#msgid368261" title="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=1728&amp;amp;t=127464&amp;amp;mc=6#msgid368261"&gt;Run EXE at the start of a Model&lt;/A&gt;‌. I was able to create a preconditon derived from a first-to-run Python script in the model, and I successfully ran a portion of my model.&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS Link isn't working. Here's the entry:&lt;/P&gt;&lt;TABLE class="forum"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH&gt;Subject&lt;/TH&gt;&lt;TD class="postvalue"&gt;Re: Run EXE at the start of a Model &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH&gt;Author&lt;/TH&gt;&lt;TD class="postvalue"&gt;Ghislain Prince &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH&gt;Date&lt;/TH&gt;&lt;TD class="postvalue"&gt;May 31, 2004 &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH&gt;Message&lt;/TH&gt;&lt;TD class="postvalue"&gt;Hi Kevin, &lt;BR /&gt;preconditions are based on variables (circles &lt;BR /&gt;in model builder). Currently your tool (EXE) has no parameters or variables. &lt;BR /&gt;What you want to do is add a parameter to it. To do so: &lt;P&gt;&lt;/P&gt;1) Right click &lt;BR /&gt;your exe in ArcToolbox &lt;BR /&gt;2) select PROPERTIES &lt;BR /&gt;3) click in the grid and add &lt;BR /&gt;a parameter with the following properties &lt;BR /&gt;- Name: type whatever you want &lt;BR /&gt;here &lt;BR /&gt;- Data Type: Boolean &lt;BR /&gt;- type: Derived &lt;BR /&gt;- Direction: Output &lt;BR /&gt;- &lt;BR /&gt;Default: TRUE &lt;BR /&gt;- leave the remaining properties to their defaults &lt;P&gt;&lt;/P&gt;Now &lt;BR /&gt;drop this tool into your model again, you'll notice that the tool now has a &lt;BR /&gt;variable (cicle) to it's right (output). So now you can specify this variable as &lt;BR /&gt;a PRECONDITION to other processes. &lt;P&gt;&lt;/P&gt;So what actually happens when the &lt;BR /&gt;model runs: once you've added a precondition on the output of your script the &lt;BR /&gt;next process will not run until your script (EXE) has been run. Once your script &lt;BR /&gt;has been run, the next process will check the variable and see that it is TRUE &lt;BR /&gt;(since that's the default), so then the next process will run. &lt;P&gt;&lt;/P&gt;Ghislain &lt;BR /&gt;Prince &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH&gt; &lt;/TH&gt;&lt;TD class="signature"&gt;Ghislain Prince &lt;BR /&gt;ESRI &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 18:24:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-in-model-builder/m-p/488676#M38192</guid>
      <dc:creator>ScottMoyer</dc:creator>
      <dc:date>2014-07-30T18:24:42Z</dc:date>
    </item>
  </channel>
</rss>

