ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / Layout Class / SetName Method
String
Example

In This Topic
    SetName Method (Layout)
    In This Topic
    Sets the name of the layout. It is important that all layouts have a unique name so they can be easily referenced. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Sub SetName( _
       ByVal name As String _
    ) 
    public void SetName( 
       string name
    )

    Parameters

    name
    String
    Exceptions
    ExceptionDescription
    This method must be called within the lambda passed to QueuedTask.Run.
    Example
    Create a new, basic layout and open it
    {
      //Create a new, basic layout and open it.
      //Create layout with minimum set of parameters on the worker thread
      //Note: Needs QueuedTask to run
      var myNewLayout = LayoutFactory.Instance.CreateLayout(8.5, 11, LinearUnit.Inches);
      myNewLayout.SetName("New 8.5x11 Layout");
    
      //Open new layout on the GUI thread
      await ProApp.Panes.CreateLayoutPaneAsync(myNewLayout);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also