I am trying to create several layer files and add them to a map document that I have already created. I attempted to use "CURRENT" for arcpy.mapping.MapDocument but I am getting an error that the map document cannot be opened. I am guessing that is because I am running this in IDLE rather than in the Python Window in ArcGIS.
The following is my code. Understandably, I have gone awry and was curious if anyone can send me in the right direction.
import arcpy, os arcpy.env.workspace = r'C:\test.gbd' fcs = arcpy.ListFeatureClasses() mxd = arcpy.mapping.MapDocument('CURRENT') DF = arcpy.mapping.ListDataFrames(mxd,'*') for feature in fcs: arcpy.MakeFeatureLayer_management('C:\test.gdb', (How could I get the code to make several feature layers?)) layer = arcpy.mapping.Layer(mxd) arcpy.mapping.AddLayer(DF,layer,"AUTO_ARRANGE")