import arcpy arcpy.AddMessage("howdy") # just for debugging--writes to arcpy console #Set Global Variables mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, '')[0] # create a new layer newlayer = arcpy.mapping.Layer(arcpy.GetParameterAsText(0)) # add the layer to the map at the bottom of the TOC in data frame 0 arcpy.mapping.AddLayer(df, newlayer,"BOTTOM") ext = newlayer.getExtent() df.extent = ext #Refresh Table of Contents arcpy.RefreshTOC() #Refresh Active View arcpy.RefreshActiveView() #sys.exit(0) # get information about a layer desc = arcpy.Describe(newlayer) arcpy.AddMessage("For the layer " + arcpy.GetParameterAsText(0)) arcpy.AddMessage("The following properties were returned from arcpy.Describe():") arcpy.AddMessage("The file name is " + desc.file) arcpy.AddMessage("The path from Arcpy.Describe is " + desc.path) arcpy.AddMessage("The element type is " + desc.dataElementType) arcpy.AddMessage("The file extension is " + desc.extension) arcpy.AddMessage("The data element type is " + desc.dataElementType)