Public Function GetConsistencyState() As NetworkDiagramConsistencyState
public NetworkDiagramConsistencyState GetConsistencyState()
Return Value
The NetworkDiagramConsistencyState of the network diagram.
Public Function GetConsistencyState() As NetworkDiagramConsistencyState
public NetworkDiagramConsistencyState GetConsistencyState()
| Exception | Description |
|---|---|
| ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. |
{
static List<NetworkDiagram> GetInconsistentDiagrams(UtilityNetwork utilityNetwork)
{
// Get the DiagramManager from the utility network
using (DiagramManager diagramManager = utilityNetwork.GetDiagramManager())
{
List<NetworkDiagram> networkDiagrams = new List<NetworkDiagram>();
// Loop through the network diagrams in the diagram manager
foreach (NetworkDiagram diagram in diagramManager.GetNetworkDiagrams())
{
NetworkDiagramInfo diagramInfo = diagram.GetDiagramInfo();
// If the diagram is not a system diagram and is in an inconsistent state, add it to our list
if (!diagramInfo.IsSystem &&
diagram.GetConsistencyState() != NetworkDiagramConsistencyState.DiagramIsConsistent)
{
networkDiagrams.Add(diagram);
}
else
{
diagram.Dispose(); // If we are not returning it we need to Dispose it
}
}
return networkDiagrams;
}
}
}
{
// 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();
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)