mxd = arcpy.mapping.MapDocument(pathtomxd) df = arcpy.mapping.ListDataFrames(mxd)[0] maplayers = arcpy.mapping.ListLayers(mxd, "", df) for maplyr in maplayers: lyrname = maplyr.name longlyrname = maplyr.longName print "Layer Name is " + lyrname print "Layer Long Name is " + longlyrname
>>> import arcpy.mapping as ma >>> mxd = ma.MapDocument("current") >>> lyr = ma.ListLayers(mxd,r"U.S. Cities")[0] >>> print lyr.longName New Group Layer\U.S. Cities
>>> for lyr in ma.ListLayers(mxd): ... print lyr.longName ... New Group Layer New Group Layer\U.S. Cities New Group Layer\U.S. Counties (Generalized)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.