ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / LayoutFactory Class / CreateLayout Method / CreateLayout(Double,Double,LinearUnit,Boolean,Double) Method
The width of the page layout in page units.
The height of the page layout in page units.
Specify the linear units.
An optional boolean to show rulers on the layout.
An optional double to specify smallest ruler division.
Example

In This Topic
    CreateLayout(Double,Double,LinearUnit,Boolean,Double) Method
    In This Topic
    Creates a layout using a simple set of parameters. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Overloads Function CreateLayout( _
       ByVal width As Double, _
       ByVal height As Double, _
       ByVal units As LinearUnit, _
       Optional ByVal showRulers As Boolean, _
       Optional ByVal smallestRulerDivision As Double _
    ) As Layout

    Parameters

    width
    The width of the page layout in page units.
    height
    The height of the page layout in page units.
    units
    Specify the linear units.
    showRulers
    An optional boolean to show rulers on the layout.
    smallestRulerDivision
    An optional double to specify smallest ruler division.

    Return Value

    Returns Layout or a null.
    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