I need to add all features within a dataset called MainSt
in a file geodatabase which is stored at following directory
C:/Temp/Roads.gdb
to current map. using following code I am able to add them one by one but can you please let me know how I can loop and add them dynamically
mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] targetGroupLayer = arcpy.mapping.ListLayers(mxd, "Main Streets", df)[0] addLayer = arcpy.mapping.Layer(r"C:\Temp\Roads.gdb\MainSt\trace_Fittings") arcpy.mapping.AddLayerToGroup(df, targetGroupLayer, addLayer, "BOTTOM") arcpy.RefreshActiveView() arcpy.RefreshTOC()
can you please let me know how to do this?