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

In This Topic
    GetPage Method (Layout)
    In This Topic
    Gets the CIMPage for a layout. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetPage() As CIMPage
    public CIMPage GetPage()

    Return Value

    Exceptions
    ExceptionDescription
    This method must be called within the lambda passed to QueuedTask.Run.
    Example
    Change the layout page size
    {
      //Change the layout page size.
      //Reference the layout project item
      LayoutProjectItem lytItem = Project.Current.GetItems<LayoutProjectItem>()
                             .FirstOrDefault(item => item.Name.Equals("MyLayoutItem"));
      if (layoutItem != null)
      {
        //Note: Needs QueuedTask to run
        //Get the layout
        Layout lyt = lytItem.GetLayout();
        if (lyt != null)
        {
          //Change properties
          CIMPage page = lyt.GetPage();
          page.Width = 8.5;
          page.Height = 11;
    
          //Apply the changes to the layout
          lyt.SetPage(page);
        }
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also