fc = arcpy.GetParameterAsText(0) arcpy.MakeFeatureLayer_management(fc, arcpy.Describe(fc).name + "_test")
test_lyr = arcpy.Describe(fc).name + "_test" mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] # choose the correct DataFrame lyr = arcpy.mapping.Layer(test_lyr) # insert your layer-name arcpy.mapping.AddLayer(df, lyr, "TOP") # choose position in TOC arcpy.RefreshTOC()
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.