ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / IElement Interface / SetName Method
String
Example

In This Topic
    SetName Method (IElement)
    In This Topic
    Sets the name of the element. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    void SetName( 
       string name
    )
    Sub SetName( _
       ByVal name As String _
    ) 

    Parameters

    name
    String
    Exceptions
    ExceptionDescription
    This method must be called within the lambda passed to QueuedTask.Run.
    Remarks
    All elements on a layout must have a unique name so they can be easily referenced.
    Example
    Element_SetName
    //Modify an element's name.
    
    //Perform on the worker thread
    await QueuedTask.Run(() =>
    {
      element.SetName("New Name");
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also