xerox1

How to add a new Group Layer using arcpy

Discussion created by xerox1 on Oct 14, 2011
Latest reply on Nov 23, 2011 by Kristya
I am trying to create a layer structure that looks something like this:

Food
   [INDENT] - Fruit
          [INDENT]-Apple
             [INDENT]<feature layers for Apples 1>
              <feature layers for Apples 2>[/INDENT][/INDENT]
          [INDENT]-Apricots
               [INDENT]<features layer for Apricots 1>
              <features layer for Apricots 2>[/INDENT][/INDENT]
etc...[/INDENT]


So what I am looking for is something that allows me to create a "layer group". Since there is not a "layer group tool" I thought I would just create one in python. That is where I am having trouble.

I can use addLayer to add a .lyr file but the only adds a layer to an existing "layer group". Can anyone tell me how to create a layer group? (other than in the GUI) Is there anyway to accomplish this that I am not seeing?

Thanks in advance.
-matt

Outcomes