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

In This Topic
    GetCanEditMetadata Method (Layout)
    In This Topic
    Gets whether the Layout metadata can be edited or not. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetCanEditMetadata() As Boolean
    public bool GetCanEditMetadata()

    Return Value

    True if the metadata is editable
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    Layout metadata is typically editable unless the .aprx is not editable
    Example
    Layout Metadata
    {
      //Note: Must be on QueuedTask.Run
    
      //Gets the Layout metadata.
      var layout_xml = layout.GetMetadata();
      //Can metadata be edited?
      if (layout.GetCanEditMetadata())
        //Set the metadata back
        layout.SetMetadata(layout_xml);
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also