I'm trying to create an mxd that can dynamically create and name group layers, and populate them with various feature layers. I've seen some examples of how to do this, such as : Creating empty group layer within existing group layer using arcpy.mapping?
The basics seem to be: reference an empty layer file:
Any examples of how to create an empty layer file (rather than reference one), within python?
Thank you,
David
أكثر...
The basics seem to be: reference an empty layer file:
- groupLayer = arcpy.mapping.Layer(r"D:\Test\GroupTest.lyr")
- arcpy.mapping.AddLayer(df, groupLayer, "BOTTOM")
- listedGroupLayer = arcpy.mapping.ListLayers(mxd, "GroupTest", df)[0]
- addLayer = arcpy.mapping.layer(r"D\Test\Rivers.lyr")
- arcpy.mapping.AddLayerToGroup(df, listedGroupLayer, addLayer, "BOTTOM")[0]
Any examples of how to create an empty layer file (rather than reference one), within python?
Thank you,
David
أكثر...