import arcpy mxd = arcpy.mapping.MapDocument("path to mxd") lyr = arcpy.mapping.ListLayers(mxd, "layer name")[0] arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", "some query") mxd.save() #If you don't want to save the selection to the existing MXD, try saving it to another file: mxd.saveACopy("path to new MXD")
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.