<?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: Need a piece of code to check FeatureLayer and more ... in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/need-a-piece-of-code-to-check-featurelayer-and/m-p/223652#M5757</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'd be better of enumerating the layers to only get feature layers. For the above code, when you convert it to a .NET equivalent you can provide an ID to the layers command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;Dim pId As New UID&lt;BR /&gt;&amp;nbsp;pId.Value = "{40A9E885-5533-11d0-98BE-00805F7CED21}"&lt;BR /&gt;&amp;nbsp;Dim pEnumLayers As IEnumLayer = pMap.Layers(pId, True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The pId value tells Arc what kind of layers to look for. This page: &lt;A class="link-titled" href="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001200000m9t000000" title="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001200000m9t000000"&gt;ArcObjects Help for .NET developers&lt;/A&gt; tells you the GUID values for different data types.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 Oct 2017 23:41:57 GMT</pubDate>
    <dc:creator>AllanMills</dc:creator>
    <dc:date>2017-10-22T23:41:57Z</dc:date>
    <item>
      <title>Need a piece of code to check FeatureLayer and more ...</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/need-a-piece-of-code-to-check-featurelayer-and/m-p/223650#M5755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need a piece of code to check if a layer in ArcMap is a FeautureLayer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMap pMap = m_mxDoc.FocusMap;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; m_mxDoc.Maps.Count; i++) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ILayer pLayer = pMap.Layer&lt;I&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;//if (typeof(pMap.Layer&lt;I&gt;) is IFeatureLayer )&amp;nbsp;&amp;nbsp; ???&amp;nbsp; How to code here?&lt;/I&gt;&lt;/EM&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Appreciate if you can help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Oct 2017 18:16:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/need-a-piece-of-code-to-check-featurelayer-and/m-p/223650#M5755</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2017-10-20T18:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need a piece of code to check FeatureLayer and more ...</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/need-a-piece-of-code-to-check-featurelayer-and/m-p/223651#M5756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is some code in VBA that shows you how to test if object is of type IFeatureLayer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Public Sub &lt;SPAN class="token function"&gt;test&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 Dim pMxDoc As IMxDocument
 Set pMxDoc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ThisDocument
 Dim pMap As IMap
 Set pMap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pMxDoc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FocusMap
 Dim pEnumLayers As IEnumLayer
 Set pEnumLayers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pMap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Layers
 Dim pLayer As ILayer
 Set pLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pEnumLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Next
 Do While Not &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pLayer Is Nothing&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 If TypeOf pLayer Is IFeatureLayer Then
 Debug&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Print &lt;SPAN class="string token"&gt;"FeatureLayer found!"&lt;/SPAN&gt;
 End If
 Set pLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pEnumLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Next
 Loop
End Sub&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:53:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/need-a-piece-of-code-to-check-featurelayer-and/m-p/223651#M5756</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-11T10:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need a piece of code to check FeatureLayer and more ...</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/need-a-piece-of-code-to-check-featurelayer-and/m-p/223652#M5757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'd be better of enumerating the layers to only get feature layers. For the above code, when you convert it to a .NET equivalent you can provide an ID to the layers command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;Dim pId As New UID&lt;BR /&gt;&amp;nbsp;pId.Value = "{40A9E885-5533-11d0-98BE-00805F7CED21}"&lt;BR /&gt;&amp;nbsp;Dim pEnumLayers As IEnumLayer = pMap.Layers(pId, True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The pId value tells Arc what kind of layers to look for. This page: &lt;A class="link-titled" href="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001200000m9t000000" title="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001200000m9t000000"&gt;ArcObjects Help for .NET developers&lt;/A&gt; tells you the GUID values for different data types.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Oct 2017 23:41:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/need-a-piece-of-code-to-check-featurelayer-and/m-p/223652#M5757</guid>
      <dc:creator>AllanMills</dc:creator>
      <dc:date>2017-10-22T23:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need a piece of code to check FeatureLayer and more ...</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/need-a-piece-of-code-to-check-featurelayer-and/m-p/223653#M5758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Revised the code as:&lt;/P&gt;&lt;P&gt;if (m_Map.Layer&lt;I&gt; is IFeatureLayer) { ... }&lt;/I&gt;&lt;/P&gt;&lt;P&gt;No need to use typeof(...)&amp;nbsp;&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Oct 2017 18:00:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/need-a-piece-of-code-to-check-featurelayer-and/m-p/223653#M5758</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2017-10-31T18:00:17Z</dc:date>
    </item>
  </channel>
</rss>

