<?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 scratchworkspace problem in modelbuilder in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/scratchworkspace-problem-in-modelbuilder/m-p/662766#M22088</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To start: You can run a model by opening it in ModelBuilder or by from a model tool dialog by double clicking a model in Catalog. This opens the tool dialog like other gp tools , except for the fact that this is a model tool dialog.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now about your problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are setting the scratchworkspace in two places: ModelBuilder and a default is set in ArcMap and run the model as a tool and not by opening the model in ModelBuilder this is what happens:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The environments of the application is called before the model starts to execute and the output is written to that scratch workspace. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to write your output to the scratch workspace set inside the model run the model from ModelBuilder. A recommended practice is always to set the workspace environment at the application level to avoid this confusion.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If for some reason you want to set it in ModelBuilder try making a workspace variable and make this variable a model parameter. This way you have the control of the output workspace where your data should be written from the tool dialog. Use the name of the variable as in-line variable substitution %variable name% in your output path which is not a model parameter&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or simply make the output a model parameter and define where you want it to be written from the model tool dialog.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Again recommended is to set the workspace at the application level.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Apr 2010 23:03:04 GMT</pubDate>
    <dc:creator>ShitijMehta</dc:creator>
    <dc:date>2010-04-12T23:03:04Z</dc:date>
    <item>
      <title>scratchworkspace problem in modelbuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/scratchworkspace-problem-in-modelbuilder/m-p/662765#M22087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm setting relative paths for geoprocessing results in a model. All data I make is set to %SCRATCHWORKSPACE%\name&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have set the scratchworkspace inside modelbuilder as a model-specific environment&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the two final files which are the ones that are added to display, do not cooperate with the scratchworkspace I set in modelbuilder, instead they take the scratchworkspace I have set in the arcmap document.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone had any experience with this ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 09:45:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/scratchworkspace-problem-in-modelbuilder/m-p/662765#M22087</guid>
      <dc:creator>ToreBorvik</dc:creator>
      <dc:date>2010-04-12T09:45:33Z</dc:date>
    </item>
    <item>
      <title>scratchworkspace problem in modelbuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/scratchworkspace-problem-in-modelbuilder/m-p/662766#M22088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To start: You can run a model by opening it in ModelBuilder or by from a model tool dialog by double clicking a model in Catalog. This opens the tool dialog like other gp tools , except for the fact that this is a model tool dialog.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now about your problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are setting the scratchworkspace in two places: ModelBuilder and a default is set in ArcMap and run the model as a tool and not by opening the model in ModelBuilder this is what happens:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The environments of the application is called before the model starts to execute and the output is written to that scratch workspace. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to write your output to the scratch workspace set inside the model run the model from ModelBuilder. A recommended practice is always to set the workspace environment at the application level to avoid this confusion.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If for some reason you want to set it in ModelBuilder try making a workspace variable and make this variable a model parameter. This way you have the control of the output workspace where your data should be written from the tool dialog. Use the name of the variable as in-line variable substitution %variable name% in your output path which is not a model parameter&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or simply make the output a model parameter and define where you want it to be written from the model tool dialog.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Again recommended is to set the workspace at the application level.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 23:03:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/scratchworkspace-problem-in-modelbuilder/m-p/662766#M22088</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2010-04-12T23:03:04Z</dc:date>
    </item>
  </channel>
</rss>

