How can you programmatically save a layer file for a wms layer?

405
0
10-14-2021 03:15 PM
KarenMeinstein
Occasional Contributor

I have a wms layer in the map that I want to programmatically save as a layer file.  Using

Geoprocessing.ExecuteToolAsync("management.SaveToLayerFile", args);

doesn't seem to work with wms layers.  As an experiment, within ArcGIS Pro I tried the corresponding Save to Layer File tool in the Data Management toolbox and it ignores the wms layer, so I'm guessing that is why my code doesn't work.  However, within Pro you can right click on the wms layer in the TOC and select Sharing > Save As Layer File and this does work, so I'm wondering if there is some way to access this programmatically.

Thanks,

Karen

Tags (2)
0 Kudos
0 Replies