<?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: Select from NALayer in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/select-from-nalayer/m-p/572588#M15426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sanjay, many thanks for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can get ILayer from INALayer, but when I try get IFeatureLayer from that ILayer I get NULL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I solved this problem using following way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeatureClass routesFeatureClass = m_NAContext.NAClasses.get_ItemByName("Routes") as IFeatureClass; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeatureLayer routesFeatureLayer = new FeatureLayerClass(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routesFeatureLayer.FeatureClass = routesFeatureClass; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; axMapControl.AddLayer(routesFeatureLayer as ILayer, 0);&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SelectByAttributeQuery(routesFeatureLayer, "myWhereClause", true);&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 29 Dec 2013 13:44:57 GMT</pubDate>
    <dc:creator>AysberqTundra</dc:creator>
    <dc:date>2013-12-29T13:44:57Z</dc:date>
    <item>
      <title>Select from NALayer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/select-from-nalayer/m-p/572585#M15423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to select a feature from Network Analysis layer. I have the result (naLayer), which is solution of some Network Analysis problem. But when I cast&amp;nbsp;&amp;nbsp; naLayer as IfeatureLayer&amp;nbsp;&amp;nbsp; I get NULL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help me to solve this problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; SelectByAttributeQuery(naLayer as IfeatureLayer, "myQuery", true);&amp;nbsp;&amp;nbsp; public void SelectByAttributeQuery(IFeatureLayer featureLayer,String whereClause,bool justOne) { &amp;nbsp;&amp;nbsp;&amp;nbsp; IMap m_map = axMapControl.Map; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (m_map.SelectionCount &amp;gt; 0) m_map.ClearSelection(); &amp;nbsp;&amp;nbsp;&amp;nbsp; IFeatureSelection featureSelection = featureLayer as IFeatureSelection; &amp;nbsp;&amp;nbsp;&amp;nbsp; IQueryFilter queryFilter = new QueryFilterClass(); &amp;nbsp;&amp;nbsp;&amp;nbsp; queryFilter.WhereClause = whereClause; &amp;nbsp;&amp;nbsp;&amp;nbsp; featureSelection.SelectFeatures(queryFilter,esriSelectionResultEnum.esriSelectionResultNew,justOne); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; axMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null); }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Dec 2013 11:49:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/select-from-nalayer/m-p/572585#M15423</guid>
      <dc:creator>AysberqTundra</dc:creator>
      <dc:date>2013-12-28T11:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select from NALayer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/select-from-nalayer/m-p/572586#M15424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So, do you get false when you execute following line?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
if ( naLayer is IFeatureLayer) 
{

}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:39:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/select-from-nalayer/m-p/572586#M15424</guid>
      <dc:creator>SanajyJadhav</dc:creator>
      <dc:date>2021-12-12T00:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Select from NALayer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/select-from-nalayer/m-p/572587#M15425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;INALayer is implemented by NALayerClass class. This class also implements ILayer and other interfaces but &lt;/SPAN&gt;&lt;STRONG&gt;not &lt;/STRONG&gt;&lt;SPAN&gt;IFeatureLayer. This could be the reason.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you try to get ILayer from INALayer and then IFeatureLayer from ILayer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HTH.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Dec 2013 12:04:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/select-from-nalayer/m-p/572587#M15425</guid>
      <dc:creator>SanajyJadhav</dc:creator>
      <dc:date>2013-12-29T12:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select from NALayer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/select-from-nalayer/m-p/572588#M15426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sanjay, many thanks for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can get ILayer from INALayer, but when I try get IFeatureLayer from that ILayer I get NULL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I solved this problem using following way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeatureClass routesFeatureClass = m_NAContext.NAClasses.get_ItemByName("Routes") as IFeatureClass; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeatureLayer routesFeatureLayer = new FeatureLayerClass(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routesFeatureLayer.FeatureClass = routesFeatureClass; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; axMapControl.AddLayer(routesFeatureLayer as ILayer, 0);&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SelectByAttributeQuery(routesFeatureLayer, "myWhereClause", true);&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Dec 2013 13:44:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/select-from-nalayer/m-p/572588#M15426</guid>
      <dc:creator>AysberqTundra</dc:creator>
      <dc:date>2013-12-29T13:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select from NALayer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/select-from-nalayer/m-p/572589#M15427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Glad your issue is fixed and thanks for posting the solution.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 03:34:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/select-from-nalayer/m-p/572589#M15427</guid>
      <dc:creator>SanajyJadhav</dc:creator>
      <dc:date>2013-12-30T03:34:36Z</dc:date>
    </item>
  </channel>
</rss>

