<?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: geoprocessing with a definition expression in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/geoprocessing-with-a-definition-expression/m-p/721498#M19231</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have code that applies the definition expression on a IGeoFeatureLayer, not the IFeatureLayer.&amp;nbsp; But I do cast to FeatureLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure if that helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
IGeoFeatureLayer functionalNeedsFeatureLayer = (FeatureLayer) RDSAMapUtility.getLayerByName(ManageMCSOEvacuationsModel.MCSOEVACUATIONSFEATURELAYERNAME);
((FeatureLayer) functionalNeedsFeatureLayer).setDefinitionExpression("EVAC_REQ_STATUS = 'EVAC NOT REQUESTED'");
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 06:51:52 GMT</pubDate>
    <dc:creator>LeoDonahue</dc:creator>
    <dc:date>2021-12-12T06:51:52Z</dc:date>
    <item>
      <title>geoprocessing with a definition expression</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geoprocessing-with-a-definition-expression/m-p/721497#M19230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to use the Geoprocessor class to run a symmetrical difference on two layers with definition expressions on them in a console application.&amp;nbsp; Whenever I run the code, the symmetrical difference is run, but the definition expression is not taken into consideration.&amp;nbsp; Has anyone else tried to use a definition expression while using the geoprocessor class?&amp;nbsp; Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//create a new layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureLayer arcFLayer1 = new FeatureLayer();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//assign the feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Layer1.FeatureClass = arcFClass1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcFLayer1.Name = 'Layer1';&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//create a definition expression&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureLayerDefinition2 arcFLayerDef1 = arcFLayer1 as IFeatureLayerDefinition2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcFLayerDef1.DefinitionExpression = "BDTYPE = 'F'";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//add it to a map object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcMapp.addLayer(arcFLayer1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//get the layer as a geofeaturelayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IGeoFeatureLayer arcGeoFLayer1 = arcMapp.get_Layer(0) as IGeoFeatureLayer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//create a new layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureLayer arcFLayer2 = new FeatureLayer();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//assign the feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Layer2.FeatureClass = arcFClass2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcFLayer2.Name = 'Layer2';&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//create a definition expression&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureLayerDefinition2 arcFLayerDef2 = arcFLayer2 as IFeatureLayerDefinition2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcFLayerDef2.DefinitionExpression = "BDTYPE = 'F'";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//add it to a map object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcMapp.addLayer(arcFLayer2);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//get the layer as a geofeaturelayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IGeoFeatureLayer arcGeoFLayer2 = arcMapp.get_Layer(0) as IGeoFeatureLayer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//create a geoprocessor objects&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Geoprocessor GP = new Geoprocessor();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//setup the symmetrical difference&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ESRI.ArcGIS.AnalysisTools.SymDiff arcSymDiff = new ESRI.ArcGIS.AnalysisTools.SymDiff();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcSymDiff.in_features = arcGeoFLayer1.DisplayFeatureClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcSymDiff.update_features = arcGeoFLayer2.DisplayFeatureClass ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcSymDiff.join_attributes = "ONLY_FID";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//execute&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GP.Execute(arcSymDiff, null);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 22:57:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geoprocessing-with-a-definition-expression/m-p/721497#M19230</guid>
      <dc:creator>GaryBilotta</dc:creator>
      <dc:date>2013-05-10T22:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: geoprocessing with a definition expression</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geoprocessing-with-a-definition-expression/m-p/721498#M19231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have code that applies the definition expression on a IGeoFeatureLayer, not the IFeatureLayer.&amp;nbsp; But I do cast to FeatureLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure if that helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
IGeoFeatureLayer functionalNeedsFeatureLayer = (FeatureLayer) RDSAMapUtility.getLayerByName(ManageMCSOEvacuationsModel.MCSOEVACUATIONSFEATURELAYERNAME);
((FeatureLayer) functionalNeedsFeatureLayer).setDefinitionExpression("EVAC_REQ_STATUS = 'EVAC NOT REQUESTED'");
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:51:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geoprocessing-with-a-definition-expression/m-p/721498#M19231</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2021-12-12T06:51:52Z</dc:date>
    </item>
  </channel>
</rss>

