arcpy.na.Directions("Network Analysis Layer","TEXT","C:/temp/" + day1 + ".txt","Miles","REPORT_TIME","Minutes")
#Get a list of all the layers in the map document mxd = arcpy.mapping.MapDocument(mxd_path) lyrs = arcpy.mapping.ListLayers(mxd) #Filter the list to obtain only the network analyst layers na_layers = [lyr for lyr in lyrs if lyr.isNetworkAnalystLayer]