ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.NetworkDiagrams Namespace / DiagramTemplate Class / GetNetworkDiagram Method
The name of the network diagram.
Example

In This Topic
    GetNetworkDiagram Method (DiagramTemplate)
    In This Topic
    Gets a NetworkDiagram based on this diagram template with the specified name. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetNetworkDiagram( _
       ByVal name As String _
    ) As NetworkDiagram
    public NetworkDiagram GetNetworkDiagram( 
       string name
    )

    Parameters

    name
    The name of the network diagram.

    Return Value

    Exceptions
    ExceptionDescription
    A geodatabase-related exception has occurred. For example, the name is invalid.
    This method or property must be called within the lambda passed to QueuedTask.Run
    Example
    Get Network Diagrams from a Diagram Template
    {
      // Get all the network diagrams from a template or a diagram by name
      static void GetNetworkDiagramFromDiagramTemplates(UtilityNetwork utilityNetwork)
      {
        using (DiagramManager diagramManager = utilityNetwork.GetDiagramManager())
        {
          // Get the first templates
          DiagramTemplate template = diagramManager.GetDiagramTemplates().FirstOrDefault();
    
          // Get the network diagrams fromt he template
          IEnumerable<NetworkDiagram> diagrams = template.GetNetworkDiagrams();
    
          // Get a network diagram by name
          NetworkDiagram diagram = template.GetNetworkDiagram(_diagramName);
        }
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also