<?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: Get 'Parent' Group Layers for an ILayer in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-parent-group-layers-for-an-ilayer/m-p/118861#M3091</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There isn't any way to do this through ArcObjects because a layer doesn't have any kind of "parent" property.&amp;nbsp; You can, however, create your own custom class that has a parent property and use it to build a lookup index of some type.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Sep 2013 12:56:19 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2013-09-24T12:56:19Z</dc:date>
    <item>
      <title>Get 'Parent' Group Layers for an ILayer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-parent-group-layers-for-an-ilayer/m-p/118860#M3090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm creating an add-in for 10.0 in C#.&amp;nbsp; Users will be working in MXD's that have nested group layers.&amp;nbsp; They'll select a layer in the TOC to work on.&amp;nbsp; In code, I get the selected layer in the TOC, and what I need to do is get the parent layers of the selected layer.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a good handle on looping through each top level layer in the map, and then each sublayer and so on, but that's going from the 'top down,' so to speak.&amp;nbsp; I want to go from the 'bottom up.'&amp;nbsp; From the child layer, get each parent.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, say I have the following structure in my table of contents.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Main Campus&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; Engineering Compound&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Group Layer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;----&amp;gt; Building 101&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;&amp;nbsp;&amp;nbsp; (Group Layer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;---------&amp;gt; Floor 1&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;&amp;nbsp; (Group Layer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;---------------&amp;gt; Classrooms&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Feature Class)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;---------------&amp;gt; Offices&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Feature Class)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;---------------&amp;gt; Storage Rooms (Feature Class)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Imagine there are many compounds and many buildings in each compound.&amp;nbsp; If a user selects Classrooms, I want to get Floor 1/Building 101/Engineering Compound/Main Campus.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Brendan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2013 12:21:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-parent-group-layers-for-an-ilayer/m-p/118860#M3090</guid>
      <dc:creator>BrendanDwyer</dc:creator>
      <dc:date>2013-09-24T12:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Get 'Parent' Group Layers for an ILayer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-parent-group-layers-for-an-ilayer/m-p/118861#M3091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There isn't any way to do this through ArcObjects because a layer doesn't have any kind of "parent" property.&amp;nbsp; You can, however, create your own custom class that has a parent property and use it to build a lookup index of some type.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2013 12:56:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-parent-group-layers-for-an-ilayer/m-p/118861#M3091</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-09-24T12:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get 'Parent' Group Layers for an ILayer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-parent-group-layers-for-an-ilayer/m-p/118862#M3092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have always found this annoying, there is no way to go back up.&amp;nbsp; You have to go top down until you find your layer and then look at the previous level in your code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2013 13:26:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-parent-group-layers-for-an-ilayer/m-p/118862#M3092</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2013-09-24T13:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get 'Parent' Group Layers for an ILayer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-parent-group-layers-for-an-ilayer/m-p/118863#M3093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There isn't any way to do this through ArcObjects because a layer doesn't have any kind of "parent" property.&amp;nbsp; You can, however, create your own custom class that has a parent property and use it to build a lookup index of some type.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yeah, that's what I was thinking of, too.&amp;nbsp; I created a class that contains a list called children which contains a list of that class.&amp;nbsp; I use this in a recursive loop that will populate each object (group layer) with it's own children.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that I only need the parents of the selected layer.&amp;nbsp; So I'd much rather go up from the selected layer than down from each top level group, then try to figure out when I get to the selected layer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2013 16:16:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-parent-group-layers-for-an-ilayer/m-p/118863#M3093</guid>
      <dc:creator>BrendanDwyer</dc:creator>
      <dc:date>2013-09-24T16:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get 'Parent' Group Layers for an ILayer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-parent-group-layers-for-an-ilayer/m-p/118864#M3094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have always found this annoying, there is no way to go back up.&amp;nbsp; You have to go top down until you find your layer and then look at the previous level in your code.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Right.&amp;nbsp; I'm surprised that this isn't built in.&amp;nbsp; Maybe in 10.3....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2013 16:18:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-parent-group-layers-for-an-ilayer/m-p/118864#M3094</guid>
      <dc:creator>BrendanDwyer</dc:creator>
      <dc:date>2013-09-24T16:18:04Z</dc:date>
    </item>
  </channel>
</rss>

