There are two workflows to refine the diagram layer definition currently set on a template. You must choose one depending on what you want to change in this definition:
- To remove existing diagram sublayers or customize settings on existing diagram sublayers—for example, change symbols, add labels, make junction symbols vary by rotation, and so on—you start your work in ArcGIS Pro from a diagram layer based on your template. Then, you alter the layers you want under the network diagram layer before exporting the diagram layer definition using the Export Diagram Layer Definition tool. This tool creates an output network diagram layer definition file (.ndld). With this complete, run the Import Diagram Template Definitions tool with the output .ndld file specified for the Diagram Layer Definition File parameter so the network diagram layer definition changes apply to each network diagram based on the diagram template.
- To add new diagram sublayers or overwrite settings on existing diagram sublayers—for example, add a sublayer to represent a new network feature source, add any additional sublayer such as the Reduction Edges sublayer after rule changes on the template diagram, switch from standard layer to subtype group layer on some diagram sublayers, and so on—you start your work with a network map. This network map must reference either the only network feature source layers you want to be added to your diagram layer or used to overwrite existing sublayers under the diagram layer, or no network feature source layer at all when the changes you expect only concern additional diagram sublayers. Then, you will run the Create Diagram Layer Definition tool with the Overwrite all layers option not checked.
These two workflows are detailed in the sections below:
- Remove existing diagram sublayers or customize settings on existing diagram sublayers
- Add new diagram sublayers or overwrite settings on existing diagram sublayers
Requirements and prerequisites
Whichever workflow you execute, the requirements and prerequisites are as follows:
- This operation must be executed from either a utility network or trace network in a file or mobile geodatabase, or a database connection to the utility network or trace network in an enterprise geodatabase. When working with a utility network or trace network in an enterprise geodatabase, you can't work from a service.
- For the case of a database connection to a utility network or trace network in an enterprise geodatabase, you must connect using the credentials of the database network owner; that is, using the database utility network owner or database trace network owner credentials.
- When working with a database connection to a utility network or trace network in an enterprise geodatabase, you must sign in to your ArcGIS Enterprise portal using the credentials of the portal network owner; that is, using the portal utility network owner or portal trace network owner credentials.
Remove existing diagram sublayers or customize settings on existing diagram sublayers
This workflow allows you to meet the needs or expectations in the following use cases:
- There are diagram sublayers that are not relevant for your network diagrams. For example, you don't need the Reduction Edge sublayer under your network diagram layer since you have no Reduce Junction or Collapse Container rules set up on your diagram template.
- You want to enable labeling on some diagram sublayers or customize the label display.
- You need to modify the appearance settings currently set up for some diagram junctions, for example, change the symbol size, make it vary by rotation, and so on.
- You want to change the name of some diagram sublayers to differentiate layers that represent point assemblies and polygon assemblies.
- You want to change the subtype order for a particular subtype group layer under your network diagram layers.
The next sections detail the four steps to execute to remove or customize existing diagram sublayers set up on a template:
- Create a map referencing the utility network or trace network data element
- Generate a diagram and edit the layers under the network diagram layer
- Export the diagram layer definition from the network diagram layer
- Import the diagram layer definition to the template
Create a map referencing the utility network or trace network data element
- Start ArcGIS Pro.
- When working with a utility network or trace network in an enterprise geodatabase, sign in to your ArcGIS Enterprise portal using the credentials of the portal network owner—that is, using the portal utility network owner or portal trace network owner credentials.
- Load your project or create one.
- Depending on the geodatabase you want to work with, do one of the following:
- When working with a utility network or trace network in a file or mobile geodatabase, add the file or mobile geodatabase to the project.
- When working with a utility network or trace network in an enterprise geodatabase, add the database connection file to the project or create one.
Caution:
Make sure the utility network or trace network is registered as branch versioned and you are connecting using the credentials of the database network owner—that is, using the database utility network owner or database trace network owner credentials.
- Activate a map that references the utility network or trace network through the database connection file or a file or mobile geodatabase, or create a map as follows:
- In the Catalog pane, on the Project tab, under Databases, expand your geodatabase item.
- Right-click the utility network or trace network data element and click Add To A New Map.
- Click Yes if you are prompted to add all source classes that participate in the network to the map.
Generate a diagram and edit the layers under the network diagram layer
To edit layers under a network diagram layer based on your template, complete the following steps:
- On the Utility Network or Trace Network tab, click the Network Options dialog box launcher in the lower right of the Diagram group.
- Under the General section, check Open diagrams with all diagram template sublayers so the All Layers mode is turned on for each network diagram layer at its loading by default.
- Select relevant network features or network objects in the active map.
- Select the network layer in the Contents pane, and on the Utility Network or Trace Network tabs in the ribbon, click the New Diagram drop-down arrow and click the template you want to refine the diagram layer definition.
A diagram map opens with a newly generated diagram.
- In the Manage group on the Network Diagram tab, ensure that All Layers is turned on.
Caution:
Without this mode enabled, you will be stopped in the next section since it is a prerequisite to running the Export Diagram Layer Definition tool. In addition, you will have to restart all the edits to your layer or subtype group layer during the next step.
- In the Contents pane, consider each layer or subtype group layer under the network diagram layer and optionally do the following:
- Remove any layer or subtype group layer that has no relevance to the diagram template.
Note:
Removing layers, subtype group layers, and subtype layers that are not relevant to the diagram template will improve display performance.
- Right-click a subtype group layer, click Properties, and click the Subtype tab to manage the subtype layer. For example, remove irrelevant subtypes, change the subtype order, and so on. Then close the Layer Properties dialog box.
- Change the name of the retained layers, subtype group layers, or subtype layers.
- Set appearance options for each layer or subtype layer.
- Set labeling options for the layers and subtype layers.
- Define the visibility range of the layers and subtype layers.
- Set diagram junction symbols to automatically rotate according to the rotation system field attribute value whose label is Element rotation so users see this attribute change when applying the Rotate Tree layout .
- Remove any layer or subtype group layer that has no relevance to the diagram template.
Set diagram junction symbols to vary by rotation
To set diagram junction symbols to automatically rotate according to the attribute values of the rotation field whose label is Element rotation, complete the following steps:
- In the Contents pane, click the diagram junction layer or subtype group layer for which you want to vary the symbols by rotation.
- On the Feature Layer tab set, click the Appearance tab. Then, in the Drawing group, click Symbology.
- Choose an unsymmetrical symbol or symbols to represent these diagram junctions so they appear different when they vary by rotation.
- At the top of the Symbology pane, click the Vary symbology by attribute tab.
- Expand the Rotation section and click Set an expression:
Caution:
Do not select Element rotation directly in the Field list at the right of the Set expression button. The Arcade expression initialized by default, in this case, looks similar to the following one—$feature.UN_5_TmpJunctions.ROTATION—and is invalid. Be sure the expression you specify is based on one of the following syntax examples instead:
- Arcade: $feature['UN_5_TmpJunctions.ROTATION']
- VBScript: [UN_5_TmpJunctions.ROTATION]
- On the Expression Builder dialog box that appears, in the Fields list, double-click the Element rotation field.
- Depending on the initial orientation of the symbols used and the rotation style—geographic or arithmetic—consider adding 90 in the Expression field so the orientation of the symbol shown in the Contents pane and in the diagram are the same when Element rotation is zero .
- Click OK.
Export the diagram layer definition from the network diagram layer
To export the diagram layer definition currently set for the network diagram layer you edited, run the Export Diagram Layer Definition geoprocessing tool by completing the following steps:
- On the Analysis tab, click Tools.
- In the Search text box, type export diagram, and select the Export Diagram Layer Definition tool.
- In the Geoprocessing pane, from the Input Network Diagram Layer drop-down list, select the diagram layer referenced in the active diagram map (the one with the layer properties you modified in the previous section). It's listed as Temporary Diagram.
- Specify the output file in the Output File parameter. Browse to and select a folder location, type a name for the network diagram layer file to create—for example, NewDiagramLayerDefinition—and click Save.
- Click Run.
A diagram layer definition file (.ndld) is created at the specified output location.
Import the network diagram layer definition to the template
To import a network diagram layer definition to a template, run the Import Diagram Template Definitions tool by completing the steps below.
Caution:
Although you can import a layer definition that has been exported from another network template, the network source and destination templates must have the following in common:
- Network type
- Domain
- Data model
- Asset type and asset group values
Whether or not the source and destination templates share the same network, you must also consider the rule and layout definitions of these templates. Some diagram layers that are needed for the destination template may be missing from the source template. This typically occurs when a Remove Feature or Reduce Junction rule is configured to systematically discard all network elements coming from a given network source class or object table on the source template. In this case, the layer under the network diagram layer that is related to those removed or reduced network elements may have been intentionally removed from the network diagram layer definition's source template, since it has no bearing on that template. However, such a layer is necessary for the destination template when there is no rule configured to remove or reduce those elements.
- On the Analysis tab, click Tools.
- In the Search text box, type import diagram, and select the Import Diagram Template Definitions tool.
- Click the Browse button next to the Input Network box, go to Project\Databases, select your geodatabase item, and browse to the utility network or trace network.
- In the Input Diagram Template drop-down list, select the template to which you want to import the network diagram layer definition.
- Click the Browse button next to the Diagram Layer Definition File box, and browse to and select the network diagram layer definition file (.ndld) generated from the Export Diagram Layer Definition tool.
- Click Run.
Caution:
When consuming the network through a service, an additional step is required to make the modified diagram template fully operational on the network service: you must connect to your ArcGIS Server and stop and restart this service.
Add new diagram sublayers or overwrite settings on existing diagram sublayers
This workflow allows you to meet needs or expectations in the following use cases:
- You changed the appearance of the network distribution junctions in your network map and want to get the benefits of this new appearance in your network diagrams.
- Your network now includes junction and edge objects and you need to get new point and polyline diagram sublayers to represent these new network objects in your network diagrams.
- You set up a new Collapse Container rule on your template and now need to include additional point layers to represent the network container polygons that are going to be systematically collapsed in your network diagrams as collapsed junctions.
- You want to switch from standard layer to subtype group layer—or conversely—on some of the additional sublayers you have under your network diagram layers.
For these situations, you must use the Create Diagram Layer Definition tool on the related diagram template. In versions earlier than ArcGIS Pro 2.7, running this tool fully reinitialized the diagram layer definition on the template, causing any custom settings you could have configured on some specific diagram sublayers to be lost. Starting with ArcGIS Pro 2.7, the Create Diagram Layer Definition tool includes a new option—Overwrite all layers—that can be unchecked to avoid the complete reinitializing of the diagram layer definition. This means that with this option not checked, you can now precisely control the diagram sublayers you want to keep and those you want to overwrite.
Follow the steps below to add new diagram sublayers or overwrite settings on existing diagram sublayers.
Tip:
To avoid losing settings after you complete the following workflow and allow going back, you can run the Export Diagram Template Definition tool to export the diagram layer definition currently set on your template. Then, if needed, you will only have to execute the Import Diagram Template Definitions tool on the template to restore the current diagram layer definition.
- Start ArcGIS Pro.
- If you already have a map referencing the utility network or trace network data element, load this map project.
- Make a copy of the network map, and open and activate it.
This copy will be used with the Create Diagram Layer Definition tool.
- For each layer in the map, verify what the network source layer represents and remove the network source layer that is already suitable for your diagram template.
The purpose is to keep only the network source layers that you want to be overwritten in the map.
When you want to change settings for additional sublayers only, you should end with no network source layer in your map. That is, you should end with the only Utility Network or Trace Network source layer in your map.
- Search for Create Diagram Layer Definition in the Geoprocessing pane search box and open the tool.
- Click the Input Network field drop-down arrow and select the Utility Network or Trace Network source layer referenced in the active map.
- In the Input Diagram Template list, select the template for which you want to refine the diagram layer definition.
- Ensure the Overwrite all layers option is not checked.
Caution:
This is the key in this workflow. Running the tool with this option checked fully overwrites the diagram layer definition on the input template. With the option not checked, only the network source layers present in the input network map and the settings maintained under the Additional Sublayers section will be considered and reflected on the current diagram layer definition.
- Expand the Additional Sublayers section and consider the following choices:
- If there is no change needed for the additional sublayers present in your diagram layer definition, uncheck each check box and remove each Network Source layer specified in the Points for edges reduced as junctions and collapsed polygons, Polygons for containers, Points for junction objects, and Points for edge objects sections and go to the next step.
- If you want to change some settings for additional sublayers, complete the following steps:
- When you want to add an additional sublayer to represent system junctions in your network diagrams or reset settings for the corresponding network diagram sublayer, keep the System Junctions box checked.
- If you configured an Add Connectivity Associations rule or a Trace rule on your template and there is no connectivity association sublayer on the diagram layer definition yet to have connectivity associations represented in your network diagrams, or if you want to reset settings for the related network diagram sublayer, keep the Connectivity Associations box checked.
- If you configured an Add Structural Attachments rule on your template and there is no structural attachment sublayer on the diagram layer definition yet to have structural attachments represented in your network diagrams, or to reset settings for this diagram sublayer, keep Structural Attachments checked.
- If you added Reduce Junction or Collapse Container rules on your template and there is no reduction edge sublayer on the diagram layer definition yet to have reduction edges represented in your network diagrams, or to reset settings for this diagram sublayer, keep Reduction Edges checked.
- If you added a Reduce Edge or Collapse Container rule on your template, consider each layer under the Points for edges reduced as junctions and collapsed polygons section and search for the network source processed by this new rule. Keep the corresponding layer if it doesn't already exist on your diagram layer definition or if you want to reset it. Then, remove any other layer.
- If there is any container polygon sublayer missing under your network diagram layer or if you want to reset settings for some, pay attention to each layer under the Polygons for containers section. Keep any layer that is missing under your network diagram layer or any layer for which you want to reset the settings. Then, remove any other layer.
- If your network now includes junction objects and you want to represent junction objects in your network diagrams, consider each layer under the Points for junction objects section. Keep any junction object layer that is missing under your network diagram layer or for which you want to reset the settings. Then, remove any other layer.
- If your network now includes edge objects and you want to represent edge objects in your network diagrams, consider each layer under the Polylines for edge objects section. Keep any edge object layer that is missing under your network diagram layer or for which you want to reset the settings. Then, remove any other layer.
- For each layer retained in steps 9e through 9h above, check the Subtype Layer check box if you want the related layer to be added or reset using preset subtype group layers. Otherwise, the layer will use simple layer representation categorized per subtype.
- Click Run.
- Generate a test diagram based on your template, turn on the All Layers mode on the diagram layer, and verify that each sublayer under the network diagram layer fits your expectations.
Optimize the diagram layer definition on templates and reduce the memory footprint on the server
When combining subtype group layers with sophisticated symbols and complex label settings for each sublayer, the diagram template layer definition can become bulky. The bulkier it is, the more it will do the following:
- Impact network diagram display performance during your ArcGIS Pro session.
- Increase the memory footprint on the server when consuming network diagrams through a network service.
Removing layers, subtype group layers, and subtype layers that are not relevant to your diagram template is recommended to improve network diagram display performance. This customization can be done for each template to reduce the maximum number of layers. In this case, you can end with different diagram layer definitions for each of your diagram templates, with each one fitting the layer requirements for each diagram template.
However, when you have several diagram templates configured for a network and consume your network diagrams through a network service, having a different layer definition for each is not recommended. When a network service starts and the related diagram templates are loaded in memory, the layer definition on each loaded template is systematically analyzed and compared to the layer definitions set on the templates that are already loaded. If the same layer definition already exists in memory, it is automatically shared with the template currently loading. This avoids loading a same layer definition multiple times and unnecessarily increasing the memory footprint on the server.
If you reduce the number of layers at maximum for each template, you may end up with a different diagram layer definition on each template and increase the memory footprint on the server, since diagram layer definitions cannot be shared between templates in this case.
While configuring your template layer definitions, you will have to balance limiting the number of different diagram layer definitions on your templates and reducing the number of layers for each diagram layer definition you shared between different templates as much as possible.