Referencing this question, Add a new group layer with python ArcGIS 10, I'm trying to use python to add a empty group within a group layer. So far I'm able to add a empty group within the map document, however I'm getting an error when trying to add another empty group within the existing group layer. Here is the error message:

i was wondering if someone could expand on how the group layer target layer in the code is defined. From the documentation its the group layer that the empty layer is going to be attached to. If it is within an MXD... does it have a physical string path. In the example above its groupLayer = arcpy.mapping.Layer(r"C:\Temp\Group.lyr") . How do you reference a layer that only exists inside a map ?
–
Jack Walker2 days ago