ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / KnowledgeGraphMappingExtensions Class / CanClearLinkChartContent Method
The link chart to clear content.
Example

In This Topic
    CanClearLinkChartContent Method
    In This Topic
    Determines if the content of the link chart map can be cleared. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Shared Function CanClearLinkChartContent( _
       ByVal linkChart As Map _
    ) As Boolean
    public static bool CanClearLinkChartContent( 
       Map linkChart
    )

    Parameters

    linkChart
    The link chart to clear content.

    Return Value

    True if the link chart content can be cleared. False otherwise.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    You should use this method before calling ClearLinkChartContent. The content can be cleared only if the Map is of type MapType.LinkChart and a Knowledge Graph layer already exists.
    Example
    Clear all content from a link chart
    {
      await QueuedTask.Run(() =>
      {
        //Get the link chart to be cleared of content
        var mapPanes = FrameworkApplication.Panes.OfType<IMapPane>().ToList();
        var mapPane = mapPanes.First(
          mp => mp.MapView.IsLinkChartView &&
          mp.MapView.Map.Name == "Acme Link Chart");
        var linkChartMap = mapPane.MapView.Map;
        //Clear all content from the link chart
        if (linkChartMap.CanClearLinkChartContent())
          linkChartMap.ClearLinkChartContent();
      });
    }
    Requirements

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

    ArcGIS Pro version: 3.7 or higher.
    See Also