<?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 setting variables within Model Builder in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91493#M3111</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using the Rotate (raster) tool in Model Builder. One of the parameters for this tool is the pivot point. I'd like to have my tool calculate the centroid of the raster, and then pass the coordinates of the centroid to the Rotate tool to use as the pivot point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using a short string of tools, I can create a point shapefile with a single point located at the centroid of the original raster. I can also add the x/y coordinates of this point to the attribute table of the point. Unfortunately, I don't know how to get the Rotate tool to use this information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As a start, I tried right-click-on-Rotate &amp;gt; make variable from parameter &amp;gt; pivot point. While I can type coordinates into this variable, I can't find a way to connect the centroid point to this variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any other ideas? Am I on the right track?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Nov 2010 18:22:21 GMT</pubDate>
    <dc:creator>TimothyHandley</dc:creator>
    <dc:date>2010-11-05T18:22:21Z</dc:date>
    <item>
      <title>setting variables within Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91493#M3111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using the Rotate (raster) tool in Model Builder. One of the parameters for this tool is the pivot point. I'd like to have my tool calculate the centroid of the raster, and then pass the coordinates of the centroid to the Rotate tool to use as the pivot point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using a short string of tools, I can create a point shapefile with a single point located at the centroid of the original raster. I can also add the x/y coordinates of this point to the attribute table of the point. Unfortunately, I don't know how to get the Rotate tool to use this information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As a start, I tried right-click-on-Rotate &amp;gt; make variable from parameter &amp;gt; pivot point. While I can type coordinates into this variable, I can't find a way to connect the centroid point to this variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any other ideas? Am I on the right track?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 18:22:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91493#M3111</guid>
      <dc:creator>TimothyHandley</dc:creator>
      <dc:date>2010-11-05T18:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: setting variables within Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91494#M3112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The easiest way is to run this model from python script.&amp;nbsp; This way you can get the X and Y coordinates and feed them directly into the Rotate Raster Tool.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 22:35:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91494#M3112</guid>
      <dc:creator>JosephSheffield</dc:creator>
      <dc:date>2010-11-05T22:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: setting variables within Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91495#M3113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been trying to avoid learning Python. While I'm sure it's more powerful and flexible, I don't think I'd have much need to use it (GIS is only about 10% of my work). So I was hoping to be able to do this within model builder. That said, it may not be possible, and I'll just have to learn Python, or do without this functionality in my model.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the thought. Any other ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 17:45:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91495#M3113</guid>
      <dc:creator>TimothyHandley</dc:creator>
      <dc:date>2010-11-09T17:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: setting variables within Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91496#M3114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know of another way to build a dynamic model.&amp;nbsp; Arc will generate 90% of the python code for you, if you export you model to python script.&amp;nbsp; When I started to learn python this is the process I used, it is really not that bad to learn.&amp;nbsp; Since, I've learned python is has added a lot of functionality that would normally take a GIS tech hours and hours to do.&amp;nbsp; Instead, python allows me to script processes and set Arc to run over night, so Arc does not take valuable computer resources during normal office hours.&amp;nbsp; Thus the process is automated and no human resources are required to run the model.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 17:53:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91496#M3114</guid>
      <dc:creator>JosephSheffield</dc:creator>
      <dc:date>2010-11-09T17:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: setting variables within Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91497#M3115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks. I guess I'll knuckle down and do it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 21:33:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91497#M3115</guid>
      <dc:creator>TimothyHandley</dc:creator>
      <dc:date>2010-11-09T21:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: setting variables within Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91498#M3116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good luck.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 21:45:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91498#M3116</guid>
      <dc:creator>JosephSheffield</dc:creator>
      <dc:date>2010-11-09T21:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: setting variables within Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91499#M3117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I've been trying to avoid learning Python. While I'm sure it's more powerful and flexible, I don't think I'd have much need to use it (GIS is only about 10% of my work). So I was hoping to be able to do this within model builder. That said, it may not be possible, and I'll just have to learn Python, or do without this functionality in my model.&lt;BR /&gt;&lt;BR /&gt;Thanks for the thought. Any other ideas?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you haven't made any progress with this, Tim, attach your model and I'll take a look.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Barbara Bicking&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Geoprocessing Team&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Nov 2010 16:42:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91499#M3117</guid>
      <dc:creator>BBicking1</dc:creator>
      <dc:date>2010-11-15T16:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: setting variables within Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91500#M3118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to pass the pivotpoint by using a small python script that accepted two parameters (x and y coords) and returned a point object. This way i am able to connect the output point object to rotate tool and it accepts that as "PivotPoint" when i drag the variable to rotate tool in model builder. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when i execute the model, the rotate tool just ignores this and uses default # option and rotates the raster along the lower left edge. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have attached a snapshot of the model if it helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to accomplish this using model builder only and without using Python and this should be possible.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 09:01:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91500#M3118</guid>
      <dc:creator>WhereMatters</dc:creator>
      <dc:date>2012-04-18T09:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: setting variables within Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91501#M3119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Anand, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Check the attachment. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You don't need to convert the raster to Poly and do all that stuff. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try something like what is shown in the attached image:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is the code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Expression:&lt;/STRONG&gt;&lt;SPAN&gt; (here your Input is the Input Raster variable name - The variable name can be x/y/anything while its value is the path to your raster - read &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Calculate_Value/004000000004000000/" rel="nofollow"&gt;Calculate Value&lt;/A&gt;&lt;SPAN&gt; help) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;fn(r"%Input%")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Code Block&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;def fn(input):&lt;BR /&gt; import arcpy&lt;BR /&gt; myRaster = arcpy.Raster(input)&lt;BR /&gt; ext = myRaster.extent&lt;BR /&gt; midx = (ext.XMax - ext.XMin) / 2&lt;BR /&gt; midy = (ext.YMax - ext.YMin) / 2&lt;BR /&gt; return "{0} {1}".format(midx,midy)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 21:59:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91501#M3119</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2012-04-18T21:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: setting variables within Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91502#M3120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry it was addressed to&amp;nbsp; thandley&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 22:00:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91502#M3120</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2012-04-18T22:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: setting variables within Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91503#M3121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Shitij!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Returning the point in the required format as illustrated in your sample code solved my problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now the rotate tool is able to read the PivotPoint&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2012 06:10:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/setting-variables-within-model-builder/m-p/91503#M3121</guid>
      <dc:creator>WhereMatters</dc:creator>
      <dc:date>2012-04-19T06:10:57Z</dc:date>
    </item>
  </channel>
</rss>

