mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0] mxdlyrs = arcpy.mapping.ListLayers(mxd, "*") for lyr in mxdlyrs: print lyr
I would like to fill a listbox with all of the FCs in a working Arcmap session.I and do a list from a GDB likeenv.workspace = "d:/foo/DefWrkCpc/Mystuff.gdb"fc_list = arcpy.ListFeatureClasses()for item in fc_list: myLstBox(.insert(END,item)I can't seem to get mxd = arcpy.mapping.MapDocument("CURRENT")nlaylst = arcpy.mapping.ListLayers(mxd)nfc_list = []for layer in nlaylst: nfc_list += arcpy.ListFeatureClasses(layer)To work any ideas?
nfc_list.append(layer)
fcList = arcpy.listFeatureClasses() for fc in fcList: nfc_list.append(fc)
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.