public IReadOnlyList<NetworkDiagram> GetNetworkDiagrams()
Public Overloads Function GetNetworkDiagrams() As IReadOnlyList(Of NetworkDiagram)
Return Value
A list of NetworkDiagrams.
public IReadOnlyList<NetworkDiagram> GetNetworkDiagrams()
Public Overloads Function GetNetworkDiagrams() As IReadOnlyList(Of NetworkDiagram)
Exception | Description |
---|---|
ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. For example, the diagram manager is invalid. |
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run |
using (DiagramManager diagramManager = utilityNetwork.GetDiagramManager()) { // get all the diagrams IReadOnlyList<NetworkDiagram> diagrams = diagramManager.GetNetworkDiagrams(); // get a diagram by name NetworkDiagram diagram = diagramManager.GetNetworkDiagram(diagrameName); // get diagrams by extent diagrams = diagramManager.GetNetworkDiagrams(extentOfInterest); // get diagrams from a set of utility network feature GlobalIDs diagrams = diagramManager.GetNetworkDiagrams(globalIDs); // get diagrams from a set of utility network feature GlobalIDs within an extent diagrams = diagramManager.GetNetworkDiagrams(extentOfInterest, globalIDs); }
public List<NetworkDiagram> GetInconsistentDiagrams(UtilityNetwork utilityNetwork) { // Get the DiagramManager from the utility network using (DiagramManager diagramManager = utilityNetwork.GetDiagramManager()) { List<NetworkDiagram> myList = 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) { myList.Add(diagram); } else { diagram.Dispose(); // If we are not returning it we need to Dispose it } } return myList; } }
Target Platforms: Windows 11, Windows 10