Select to view content in your preferred language

Rename an existing layer

579
1
Jump to solution
01-06-2022 03:56 AM
DavidMrázek
Frequent Contributor

Hello,

is there a way to rename an existing layer? As soon as I set the path automatically

string file = CoreModule.CurrentProject.DefaultGeodatabasePath;

the program enters the name of the folder where it was saved. I would like to set the name according to myself at a later stage.

Thank you in advance for your reply
David

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

Use method SetName of Layer object.

layer.SetName("New layer name");

View solution in original post

1 Reply
GKmieliauskas
Esri Regular Contributor

Hi,

Use method SetName of Layer object.

layer.SetName("New layer name");