ArcGIS Pro 3.0 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 NetworkDiagram GetNetworkDiagram()
    Public Function GetNetworkDiagram() As NetworkDiagram

    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
    public void GetDiagram(DiagramLayer diagramLayer)
    {
      // note - methods need to run on MCT
    
      NetworkDiagram diagram = diagramLayer.GetNetworkDiagram();
    
      // get the consistency state from the layer
      DiagramLayerConsistencyState dlState = diagramLayer.ConsistencyState;
    
      // or from the diagram
      NetworkDiagramConsistencyState ndState = diagram.GetConsistencyState();
    }
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also