I am trying to save a layer from an MXD to a lyrx file in a geodatabase using ArcGIS Pro.
aprx.importDocument(current_document_name) mlist = aprx.listMaps() infra_layers = mlist.listLayers() arcpy.SaveToLayerFile_management(infra_layers.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?.