Starting with 10.9, you can create SOEs that target network diagrams and so extend functionalities beyond the REST resources and operations already provided with the Network Diagram Service resource hierarchy.
This topic provides most of the essential code snippets you can re-use while developing your network diagram SOEs.
Retrieve the diagram dataset related to a utility network
Network Diagrams being a capability of the ArcGIS Utility Network Management Extension, you must start by retrieving the utility network related to the utility network service extension enabled on a map service like explained in Open a utility network dataset.
Then, you can easily access the underlying diagram dataset like follows:
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
public IDiagramDataset GetDiagramDataset() {
IBaseNetwork unBaseNetwork = GetUtilityNetwork();
if (unBaseNetwork != null)
return unBaseNetwork.DiagramDataset as IDiagramDataset;
returnnull;
}
Walk through the main network diagram interfaces and classes
Network Diagrams OMD
The Network Diagrams Object Model document provides the detailed Object Model Diagrams (OMDs) of the network diagram classes, interfaces and enumerations exposed in the Enterprise SDK.
Access the network diagrams and diagram templates
A diagram template holds the configuration properties defining the content (rule and layout definitions) and presentation (diagram layer definition) of network diagrams. When a user generates a network diagram, he chooses the diagram template on which he wants his network diagram to be based. There are three out-of-the-box diagram templates installed by default at the utility network creation but the utility network administrator could have created and configured his own diagram templates or deleted those installed by default.
Here are the way to access the diagram templates that exist for a given diagram dataset:
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
public IEnumDiagramTemplate GetDiagramTemplates(IDiagramDataset DiagramDataset) {
if (DiagramDataset != null)
return DiagramDataset.DiagramTemplates;
returnnull;
}
Network diagrams are representations of a set of network features or network objects that participate in the utility network. Any newly generated network diagram is temporary by default until it is stored in the diagram dataset. You can access the stored network diagrams related to a diagram dataset as follows:
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
public IEnumNetworkDiagram GetDiagrams(IDiagramDataset DiagramDataset) {
if (DiagramDataset != null)
return DiagramDataset.NetworkDiagrams;
returnnull;
}
Depending on its layout, the extent of a network diagram, DiagramExtent, may be more or less close to the geographical extent of the utility network features it represents, NetworkExtent.
This first sample code snippet retrieves the name of the network diagram with the larger diagram extent: