<?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 using OpenFeatureQuery in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415615#M11166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure how to change the extent of this layer.&amp;nbsp; You might consider using IFeatureLayerDefinition.CreateSelectionLayer instead - the resulting layer has an extent based on features that it contains.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Option Explicit
Sub Test()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pWSF As IWorkspaceFactory
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pWSF = New FileGDBWorkspaceFactory
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFWS As IFeatureWorkspace
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFWS = pWSF.OpenFromFile("D:\Projects\SAWS\data\EncinoPark.gdb", 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFLayer As IFeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFLayer = New FeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFLayer.FeatureClass = pFWS.OpenFeatureClass("EARZ_ZONES2")
&amp;nbsp;&amp;nbsp;&amp;nbsp; pFLayer.Name = "mylayer"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pQF As IQueryFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pQF = New QueryFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; pQF.WhereClause = """EARZ_ZONE"" = 'AREA 5'"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFSel As IFeatureSelection
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFSel = pFLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; pFSel.SelectFeatures pQF, esriSelectionResultNew, False
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFLD As IFeatureLayerDefinition
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFLD = pFSel
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayer As ILayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pLayer = pFLD.CreateSelectionLayer("mylayer", True, "", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMxDoc = ThisDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; pMxDoc.FocusMap.AddLayer pLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:50:09 GMT</pubDate>
    <dc:creator>KirkKuykendall</dc:creator>
    <dc:date>2021-12-11T18:50:09Z</dc:date>
    <item>
      <title>Problem using OpenFeatureQuery</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415614#M11165</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;When I do an OpenFeatureQuery to seach by attribute in a lake dataset it result a featurelayer where the extend is the same as Lake. I mean that if I only have 1 lake resulting from my query def, zoom to layer won't bring me to that lake it zoom out to the dataset extend. My code works fine and the result looks great too but I'd like to set the extend of the resulting feature layer to an envelope that would fit the selection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated. Thanks !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;AcrGIS Engine 9.3.1; vb.net 2008; SDE 9.3.1 (arcGIS Server basic).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Apr 2010 19:19:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415614#M11165</guid>
      <dc:creator>GéomatiqueSopfeu</dc:creator>
      <dc:date>2010-04-07T19:19:44Z</dc:date>
    </item>
    <item>
      <title>Problem using OpenFeatureQuery</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415615#M11166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure how to change the extent of this layer.&amp;nbsp; You might consider using IFeatureLayerDefinition.CreateSelectionLayer instead - the resulting layer has an extent based on features that it contains.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Option Explicit
Sub Test()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pWSF As IWorkspaceFactory
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pWSF = New FileGDBWorkspaceFactory
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFWS As IFeatureWorkspace
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFWS = pWSF.OpenFromFile("D:\Projects\SAWS\data\EncinoPark.gdb", 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFLayer As IFeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFLayer = New FeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFLayer.FeatureClass = pFWS.OpenFeatureClass("EARZ_ZONES2")
&amp;nbsp;&amp;nbsp;&amp;nbsp; pFLayer.Name = "mylayer"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pQF As IQueryFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pQF = New QueryFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; pQF.WhereClause = """EARZ_ZONE"" = 'AREA 5'"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFSel As IFeatureSelection
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFSel = pFLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; pFSel.SelectFeatures pQF, esriSelectionResultNew, False
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFLD As IFeatureLayerDefinition
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFLD = pFSel
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayer As ILayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pLayer = pFLD.CreateSelectionLayer("mylayer", True, "", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMxDoc = ThisDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; pMxDoc.FocusMap.AddLayer pLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:50:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415615#M11166</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2021-12-11T18:50:09Z</dc:date>
    </item>
    <item>
      <title>Problem using OpenFeatureQuery</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415616#M11167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Kirk... I really tried your code but some problems : 1) if I open then attribute table, it will contains the 73000 records even if only 66 records were selected (and 66 are displayed) and 2) Unfortunatly, the zoom to extend doesn't work either. I tried to play around with the code without any success. What am I doing wrong ???&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 17:17:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415616#M11167</guid>
      <dc:creator>GéomatiqueSopfeu</dc:creator>
      <dc:date>2010-04-08T17:17:26Z</dc:date>
    </item>
    <item>
      <title>Problem using OpenFeatureQuery</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415617#M11168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When I run the code above with a path to the data in the attached file gdb, and open the attribute window, I only see one row.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Right clicking on the layer and choosing zoom to extent will zoom to whatever features are present in the layer (created using code posted previously).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I see that IGeoDataset.Extent for the layer is still the full extent of the layer, so&amp;nbsp; I guess zoom to layer uses some other method.&amp;nbsp; I wouldn't think it would loop through each feature to build an envelope, but I don't see what else it would use.&amp;nbsp; Setting ILayer2.AreaOfInterest doesn't change the behavior of zoom to extent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;9.3.1 sp 1 Vista64&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 18:23:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415617#M11168</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2010-04-08T18:23:00Z</dc:date>
    </item>
    <item>
      <title>Problem using OpenFeatureQuery</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415618#M11169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Finally, funny facts !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried with a filegeo in Engine : it did'nt work better. Cannot zoom to extend and all features are in the attribute table. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BUT, I tried in arcMap VBA : Tada ! Everyting works fine !!! I can zoom to layer and only the selected features are in the attribute table. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I guess it is a problem with arcEngine OR the way to proceed is a bit different (but undocumented, of course).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Apr 2010 11:51:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415618#M11169</guid>
      <dc:creator>GéomatiqueSopfeu</dc:creator>
      <dc:date>2010-04-09T11:51:07Z</dc:date>
    </item>
    <item>
      <title>Problem using OpenFeatureQuery</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415619#M11170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How are you populating your attribute window?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should cast the featurelayer to an IDisplayTable, then load rows into your datagrid (or whatever) by looping through rows returned by the ICursor returned from IDisplayTable.SearchDisplayTable.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Apr 2010 13:30:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415619#M11170</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2010-04-09T13:30:02Z</dc:date>
    </item>
    <item>
      <title>Problem using OpenFeatureQuery</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415620#M11171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It is true that using OpenFeatureClass, I would have to specify my query to correctly set my iDisplayTable; but as OpenFetaureQuery works fine with it, I'd like to keep my open attribute table function as general as I can. Otherwise, I would have know, for each featureLayer in my table of content if there's a query to apply or not and so on... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I now hope that ESRI can figure it out. Thank you for your precious help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Apr 2010 19:24:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415620#M11171</guid>
      <dc:creator>GéomatiqueSopfeu</dc:creator>
      <dc:date>2010-04-09T19:24:28Z</dc:date>
    </item>
    <item>
      <title>Problem using OpenFeatureQuery</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415621#M11172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Using IDisplayTable for any featurelayer (regardless of whether it was created as a selection layer) should return the rows that you see when you display the layer attribute window in arcmap.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Apr 2010 19:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-using-openfeaturequery/m-p/415621#M11172</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2010-04-09T19:28:43Z</dc:date>
    </item>
  </channel>
</rss>

