public NetworkDiagram GetNetworkDiagram( string name )
Public Function GetNetworkDiagram( _ ByVal name As String _ ) As NetworkDiagram
Parameters
- name
- The name of the network diagram.
Return Value
The NetworkDiagram with the specified name.
public NetworkDiagram GetNetworkDiagram( string name )
Public Function GetNetworkDiagram( _ ByVal name As String _ ) As NetworkDiagram
Exception | Description |
---|---|
ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. |
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 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); } }
Target Platforms: Windows 11, Windows 10