ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / Layout Class / SetDefinition Method
CIMLayout
Example

In This Topic
    SetDefinition Method (Layout)
    In This Topic
    Applies the changes made to a modified ArcGIS.Core.CIM.CIMLayout back to the element on the page layout. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void SetDefinition( 
       CIMLayout cimLayout
    )
    Public Sub SetDefinition( _
       ByVal cimLayout As CIMLayout _
    ) 

    Parameters

    cimLayout
    CIMLayout
    Exceptions
    ExceptionDescription
    This method must be called within the lambda passed to QueuedTask.Run.
    Example
    Layout_GetSetDefinition
    //Modify a layout's CIM definition
    
    //Perform on the worker thread
    await QueuedTask.Run(() =>
    {
      CIMLayout cimLayout = layout.GetDefinition();
    
      //Do something
    
      layout.SetDefinition(cimLayout);
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also