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

GetNetworkDiagram Method (DiagramLayer)
Gets network diagram associated with the layer. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
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
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

ArcGIS Pro version: 3 or higher.
See Also