Skip to content

Instantly share code, notes, and snippets.

@debboutr
Created July 18, 2016 17:56
Show Gist options
  • Save debboutr/19eebaee5c01155cc9d80835961eef58 to your computer and use it in GitHub Desktop.
Save debboutr/19eebaee5c01155cc9d80835961eef58 to your computer and use it in GitHub Desktop.
import os
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
place = 'D:/Projects/chkNRSA_Watersheds/arcpyWSheds'
for f in os.listdir(place):
if '.shp' in f and not '.xml' in f:
if f[:9].replace('_','-') in wsheds:
addLayer = arcpy.mapping.Layer('%s/%s' % (place, f))
arcpy.mapping.AddLayer(df,addLayer,"BOTTOM")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment