Dataset does not exist or is unsupported SaveLayerToFile

by Steve Scott   Last Updated October 09, 2019 18:22 PM

I am trying to save a layer from an MXD to a lyrx file in a geodatabase using ArcGIS Pro.

mlist = aprx.listMaps()
infra_layers = mlist[0].listLayers()
arcpy.SaveToLayerFile_management(infra_layers[0].name, new_file_name, 'ABSOLUTE')

I am getting the following error:

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Layer: Dataset active_infrastructure_projects does not exist or is not supported
Failed to execute (SaveToLayerFile).

So the name exists and the layer is being imported. Why can't it save the layer? Why is it not supported?.

Related Questions

Updated March 16, 2017 23:22 PM

Updated August 07, 2015 14:09 PM

Updated March 02, 2016 01:09 AM

Updated November 07, 2017 08:22 AM