import arcpy from arcpy import env # for setting overall extent def LoadAllMyShapefiles(mypath): # Set the workspace for the ListFeatureClass function env.workspace = mypath # Use the ListFeatureClasses function to return a list of # all shapefiles. fcList = arcpy.ListFeatureClasses() print 'the workspace ' + env.workspace + ' contains ' + str(len(fcList)) + ' shapefiles.' # get the current map document and first dataframe mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, '')[0] for fc in fcList: # for each shapefile found in the folder... pathToFC = env.workspace + '/' + fc # create a complete path that includes the shapefile newlayer = arcpy.mapping.Layer(pathToFC) # create a layer from the path arcpy.mapping.AddLayer(df,newlayer,"BOTTOM") # add the layer to the dataframe #Refresh Table of Contents arcpy.RefreshTOC() #Refresh Active View arcpy.RefreshActiveView()