ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.NetworkDiagrams Namespace / DiagramManager Class / GetDiagramTemplate Method
The name of the diagram template.
Example

In This Topic
    GetDiagramTemplate Method
    In This Topic
    Retrieves the DiagramTemplate with the specified name. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetDiagramTemplate( _
       ByVal name As String _
    ) As DiagramTemplate
    public DiagramTemplate GetDiagramTemplate( 
       string name
    )

    Parameters

    name
    The name of the diagram template.

    Return Value

    The DiagramTemplate with the specified name.
    Exceptions
    ExceptionDescription
    A geodatabase-related exception has occurred.
    This method or property must be called within the lambda passed to QueuedTask.Run
    Example
    Get Diagram Templates
    {
      // Get all the diagram templates or a template by name
      static void RetrieveDiagramTemplates(UtilityNetwork utilityNetwork)
      {
        string templateName = "ElectricNetworkTemplate";
        using DiagramManager diagramManager = utilityNetwork.GetDiagramManager();
    
        // Get all templates
        IReadOnlyList<DiagramTemplate> templates = diagramManager.GetDiagramTemplates();
    
        // Get a template by name
        DiagramTemplate template = diagramManager.GetDiagramTemplate(templateName);
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also