ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / DiagramLayer Class / GetNetworkDiagram Method
Example

In This Topic
    GetNetworkDiagram Method (DiagramLayer)
    In This Topic
    Gets network diagram associated with the layer. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetNetworkDiagram() As NetworkDiagram
    public NetworkDiagram GetNetworkDiagram()

    Return Value

    The network diagram associated with the layer.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Could not open the network diagram.
    Example
    Get Diagram from DiagramLayer
    {
      // Get the NetworkDiagram from a DiagramLayer and check its ConsistencyState
      static void GetDiagram(DiagramLayer diagramLayer)
      {
        NetworkDiagram diagram = diagramLayer.GetNetworkDiagram();
    
        // Get the consistency state from the layer
        DiagramLayerConsistencyState diagramLayerConsistencyState = diagramLayer.ConsistencyState;
    
        // Or from the diagram
        NetworkDiagramConsistencyState diagramConsistencyState = diagram.GetConsistencyState();
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also