public sealed class NetworkDiagram : ArcGIS.Core.CoreObjectsBase, System.IDisposable
Public NotInheritable Class NetworkDiagram Inherits ArcGIS.Core.CoreObjectsBase Implements System.IDisposable
public sealed class NetworkDiagram : ArcGIS.Core.CoreObjectsBase, System.IDisposable
Public NotInheritable Class NetworkDiagram Inherits ArcGIS.Core.CoreObjectsBase Implements System.IDisposable
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; } }
// Create a diagram layer from a NetworkDiagram (myDiagram) DiagramLayer diagramLayer = await QueuedTask.Run<DiagramLayer>(() => { // Create the diagram map var newMap = MapFactory.Instance.CreateMap(myDiagram.Name, ArcGIS.Core.CIM.MapType.NetworkDiagram, MapViewingMode.Map); if (newMap == null) return null; // Open the diagram map var mapPane = ArcGIS.Desktop.Core.ProApp.Panes.CreateMapPaneAsync(newMap, MapViewingMode.Map); if (mapPane == null) return null; //Add the diagram to the map return newMap.AddDiagramLayer(myDiagram); });
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(); }
public void CreateNetworkDiagram(UtilityNetwork utilityNetwork, IEnumerable<Guid> globalIDs) { using (DiagramManager diagramManager = utilityNetwork.GetDiagramManager()) { // get the template DiagramTemplate template = diagramManager.GetDiagramTemplate(templateName); // create the diagram NetworkDiagram diagram = diagramManager.CreateNetworkDiagram(template, globalIDs); } }
public void GetDiagramContent(UtilityNetwork utilityNetwork) { using (DiagramManager diagramManager = utilityNetwork.GetDiagramManager()) { // get a diagram by name NetworkDiagram diagram = diagramManager.GetNetworkDiagram(templateName); string json_content = diagram.GetContent(true, true, true, true); } }
public void DiagramElementQueryResultAndNetworkDiagramSubsetClasses(Geodatabase geodatabase, DiagramManager diagramManager, string diagramName) { // Retrieve a diagram using (NetworkDiagram diagramTest = diagramManager.GetNetworkDiagram(diagramName)) { // Create a DiagramElementQueryByElementTypes query object to get the diagram elements we want to work with DiagramElementQueryByElementTypes query = new DiagramElementQueryByElementTypes(); query.QueryDiagramJunctionElement = true; query.QueryDiagramEdgeElement = true; query.QueryDiagramContainerElement = true; // Retrieve those diagram elements DiagramElementQueryResult elements = diagramTest.QueryDiagramElements(query); // Create a NetworkDiagramSubset object to edit this set of diagram elements NetworkDiagramSubset subset = new NetworkDiagramSubset(); subset.DiagramJunctionElements = elements.DiagramJunctionElements; subset.DiagramEdgeElements = elements.DiagramEdgeElements; subset.DiagramContainerElements = elements.DiagramContainerElements; // Edit the shapes of the diagram elements - left as an exercise for the student TranslateDiagramElements(subset); // Save the new layout of the diagram elements diagramTest.SaveLayout(subset, true); } }
System.Object
ArcGIS.Core.CoreObjectsBase
ArcGIS.Core.Data.NetworkDiagrams.NetworkDiagram
Target Platforms: Windows 11, Windows 10, Windows 8.1