<?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 Problem setting the extent on the geoprocessor in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/problem-setting-the-extent-on-the-geoprocessor/m-p/124147#M4330</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having trouble setting the extent environment value for the geoprocessor using C#.&amp;nbsp; I have the following code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;ESRI.ArcGIS.Geoprocessor.Geoprocessor gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
gp.SetEnvironmentValue("extent", "30 30 50 50");
ESRI.ArcGIS.ConversionTools.FeatureClassToFeatureClass featureTofeature = new ESRI.ArcGIS.ConversionTools.FeatureClassToFeatureClass();
featureTofeature.in_features = connectionFile + "\\" + featureClassName;
featureTofeature.out_path = saveDirectoryPath;
featureTofeature.out_name = featureExportName;
featureTofeature.where_clause = query.WhereClause;
IGeoProcessorResult result = (IGeoProcessorResult)gp.Execute(featureTofeature, null);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The result is that it exports all features and ignores the extent.&amp;nbsp; If I run the same tool with the same inputs through ArcCatalog then it works as expected so the FeatureClassToFeatureClass tool should make use of the extent environment variable.&amp;nbsp; Can anyone see what I have missed here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&amp;nbsp; Some more investigation has revealed that if I comment out the where_clause then it does work as expected (I confess that I didn't fill out the where clause when running the tool through ArcCatalog), so how can I use both an extent and a where clause?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Mar 2011 15:29:45 GMT</pubDate>
    <dc:creator>OllieNewman</dc:creator>
    <dc:date>2011-03-17T15:29:45Z</dc:date>
    <item>
      <title>Problem setting the extent on the geoprocessor</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problem-setting-the-extent-on-the-geoprocessor/m-p/124147#M4330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having trouble setting the extent environment value for the geoprocessor using C#.&amp;nbsp; I have the following code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;ESRI.ArcGIS.Geoprocessor.Geoprocessor gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
gp.SetEnvironmentValue("extent", "30 30 50 50");
ESRI.ArcGIS.ConversionTools.FeatureClassToFeatureClass featureTofeature = new ESRI.ArcGIS.ConversionTools.FeatureClassToFeatureClass();
featureTofeature.in_features = connectionFile + "\\" + featureClassName;
featureTofeature.out_path = saveDirectoryPath;
featureTofeature.out_name = featureExportName;
featureTofeature.where_clause = query.WhereClause;
IGeoProcessorResult result = (IGeoProcessorResult)gp.Execute(featureTofeature, null);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The result is that it exports all features and ignores the extent.&amp;nbsp; If I run the same tool with the same inputs through ArcCatalog then it works as expected so the FeatureClassToFeatureClass tool should make use of the extent environment variable.&amp;nbsp; Can anyone see what I have missed here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&amp;nbsp; Some more investigation has revealed that if I comment out the where_clause then it does work as expected (I confess that I didn't fill out the where clause when running the tool through ArcCatalog), so how can I use both an extent and a where clause?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2011 15:29:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problem-setting-the-extent-on-the-geoprocessor/m-p/124147#M4330</guid>
      <dc:creator>OllieNewman</dc:creator>
      <dc:date>2011-03-17T15:29:45Z</dc:date>
    </item>
  </channel>
</rss>

