ArcGIS Pro 2.7 API Reference Guide
DeleteElements(IEnumerable<Element>) Method

ArcGIS.Desktop.Layouts Namespace > Layout Class > DeleteElements Method : DeleteElements(IEnumerable<Element>) Method
The elements being removed
Deletes the elements from a page layout. This method must be called on the MCT. Use QueuedTask.Run
Syntax
public void DeleteElements( 
   IEnumerable<Element> elements
)
Public Overloads Sub DeleteElements( _
   Optional ByVal elements As IEnumerable(Of Element) _
) 

Parameters

elements
The elements being removed
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
elements must belong to layout 'URI'
Remarks
If elements is null then all elements are deleted.
If a group element is provided in the list of elements to be deleted then the group element and all its children will be deleted.
If a child of a group element is provided in the list in addition to its parent then the parent takes precedence (i.e. the entire group element is deleted and not just that child)
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

Layout Class
Layout Members
Overload List