<?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: Can model builder automaticly update output names? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530138#M17675</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was hoping there was an easier answer (like a button to check).&amp;nbsp; I only need to run the model about 100 times and am not sure writing the script would be time efficent.&amp;nbsp; There is another section of the model that also needs to use the input file to go grab another file so that may be the best solution though.&amp;nbsp; This way I could just use the same code to call to both.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Aug 2013 16:17:56 GMT</pubDate>
    <dc:creator>TomKearns</dc:creator>
    <dc:date>2013-08-08T16:17:56Z</dc:date>
    <item>
      <title>Can model builder automaticly update output names?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530136#M17673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a model built that will take a line.shp file, manipulate it and produce two other .shp files.&amp;nbsp; The input file as well as the two output files are marked as Parameters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like my output files to be named based on the intitial input file.&amp;nbsp; As it is now, when the tool is run the parameter inputs default to the name of the file I used to build the model. When a new file is put into the first parameter box, I would like the other two to also update to reflect the change. Is there a way to have the second two parameters update when the first is set?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 16:04:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530136#M17673</guid>
      <dc:creator>TomKearns</dc:creator>
      <dc:date>2013-08-08T16:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can model builder automaticly update output names?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530137#M17674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe export your model to python and then insert a script that uses your input names and creates the output naming?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 16:10:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530137#M17674</guid>
      <dc:creator>TimWitt</dc:creator>
      <dc:date>2013-08-08T16:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can model builder automaticly update output names?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530138#M17675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was hoping there was an easier answer (like a button to check).&amp;nbsp; I only need to run the model about 100 times and am not sure writing the script would be time efficent.&amp;nbsp; There is another section of the model that also needs to use the input file to go grab another file so that may be the best solution though.&amp;nbsp; This way I could just use the same code to call to both.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 16:17:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530138#M17675</guid>
      <dc:creator>TomKearns</dc:creator>
      <dc:date>2013-08-08T16:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can model builder automaticly update output names?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530139#M17676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I was hoping there was an easier answer (like a button to check).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use the Parse Path tool to extract the name of an input, then use that model variable in the output file name as something like "out_%base name%.shp".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2013 01:31:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530139#M17676</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2013-08-09T01:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can model builder automaticly update output names?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530140#M17677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That worked perfectly.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I just need to figure out how to split up my file name (an 8 digit number) using python to call a file half way through the script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;12345678 needs to become C:/Temp/12/34/56/78&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The new file is an input for a spatial join so parsing doesn't seem to work since it only produces strings.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 22:15:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530140#M17677</guid>
      <dc:creator>TomKearns</dc:creator>
      <dc:date>2013-08-12T22:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can model builder automaticly update output names?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530141#M17678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Now I just need to figure out how to split up my file name (an 8 digit number) using python to call a file half way through the script.&lt;BR /&gt;&lt;BR /&gt;12345678 needs to become C:/Temp/12/34/56/78&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could use this python expression inside the Calculate Value tool. All modelbuilder element values are strings so you can can slice them up using string slicing syntax:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
"C:/TEMP/{0}/{1}/{2}/{3}".format("%name%"[:2],"%name%"[2:4], "%name%"[4:6], "%name%"[6:8])
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Python slice addresses work like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
0---1---2---3
&amp;nbsp; a&amp;nbsp;&amp;nbsp; b&amp;nbsp;&amp;nbsp; c
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[:2] is "ab"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[1:3] is "bc"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:04:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/can-model-builder-automaticly-update-output-names/m-p/530141#M17678</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T23:04:44Z</dc:date>
    </item>
  </channel>
</rss>

