Refine the diagram layer definition on a template

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 on 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:

Requirements and prerequisites

Whatever the workflow you will 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 nor Collapse Container rules set up on your diagram template.
  • You want to enable labeling on some diagram sublayer and customize the label display.
  • You need to modify the appearance settings currently set up for some diagram junctions, for example, 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:

  1. Create a map referencing the utility network or trace network data element.
  2. Generate a diagram and edit the layers under the network diagram layer.
  3. Export the diagram layer definition from the network diagram layer.
  4. Import the diagram layer definition to the template.

Create a map referencing the utility network or trace network data element

  1. Start ArcGIS Pro.
  2. 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.
  3. Load your project or create one.
  4. 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.

  5. Activate a map that references the utility network or trace network through the database connection file, file or mobile geodatabase, or create a map as follows:
    1. In the Catalog pane, on the Project tab, under Databases, expand your geodatabase item.
    2. Right-click the utility network or trace network data element and click Add To A New Map.
    3. 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:

  1. On the Utility Network or Trace Network tab, click the Network Options dialog box launcher Launcher in the lower right of the Diagram group.
  2. 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.
  3. Select relevant network features or network objects in the active map.
  4. Select the network layer in the Contents pane, and on the Data tab of the utility network or trace network tab set, 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.

  5. In the Manage group on the Network Diagram tab, ensure that All Layers is enabled.
    Caution:

    Without this mode enabled, you will be stopped in the next section since it is a prerequisite to the Export Diagram Layer Definition tool execution. In addition, you will have to restart all the edits done on your layer or subtype group layer during the next step.

  6. In the Contents pane, consider each layer or subtype group layer under the network diagram layer and optionally do the following:
    1. 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.

    2. 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.
    3. Change the name of the retained layers, subtype group layers, or subtype layers.
    4. Set appearance options for each layer or subtype layer.
    5. Set labeling options for the layers and subtype layers.
    6. Define the visibility range of the layers and subtype layers.
    7. 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.

Get diagram junction symbols 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:

  1. In the Contents pane, click the diagram junction layer or subtype group layer for which you want to vary the symbols by rotation.
  2. On the Feature Layer tab set, click the Appearance tab. Then, in the Drawing group, click Symbology.
  3. Choose unsymmetrical symbol or symbols to represent these diagram junctions so they appear different when they vary by rotation.
  4. At the top of the Symbology pane, click the Vary symbology by attribute tab.
  5. Then, expand the Rotation section and click Set an expression:
    Rotation section on the Vary symbology by attribute tab
    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 close to the following one—$feature.UN_5_TmpJunctions.ROTATION—and is invalid. Make sure the expression you specify is based on one of the following syntax instead:

    • Arcade: $feature['UN_5_TmpJunctions.ROTATION']
    • VBScript: [UN_5_TmpJunctions.ROTATION]
    .

  6. On the Expression Builder dialog box that appears, in the Fields list, double-click the Element rotation field.
  7. Depending on the initial orientation of the used symbols and on 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 .
    Custom expression to rotate diagram junctions
  8. 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, as explained in the following steps:

  1. On the Analysis tab, click Tools.
  2. In the Search text box, type export diagram, and select the Export Diagram Layer Definition tool.
  3. 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 section above). It's listed as Temporary Diagram.
  4. Specify the Output File. In other words, browse to and select a folder location, type a name for the network diagram layer file to create—NewDiagramLayerDefinition, for example—and click Save.
  5. 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, as described in the following steps.

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:

  • The same network type
  • The same domain
  • The same data model
  • The same asset type and asset group values
In addition, if some layer properties and labels are based on specific attributes, those same attributes must exist on the related network source classes of the destination template.

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.

  1. On the Analysis tab, click Tools.
  2. In the Search text box, type import diagram, and select the Import Diagram Template Definitions tool.
  3. 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.
  4. In the Input Diagram Template drop-down list, select the template to which you want to import the network diagram layer definition.
  5. 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.
  6. Click Run.

Caution:

When consuming the network through a service, an additional step is required to get 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 the 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.

The workflow below details the steps to execute 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 present diagram layer definition.

  1. Start ArcGIS Pro.
  2. Then, supposing you already have a map referencing the utility network or trace network data element, load this map project.
  3. Make a copy of the network map. Then, open and activate this map copy.

    This copy will be used with the Create Diagram Layer Definition tool.

  4. For each layer in the map, verify what the network source layer represents and remove the network source layer that is already fine for your diagram template.

    The purpose is to keep in the map the only network source layers that you want to be overwritten.

    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.

  5. Search for Create Diagram Layer Definition in the Geoprocessing pane search box and open the tool.
  6. Click the Input Network field drop-down arrow and select the Utility Network or Trace Network source layer referenced in the active map.
  7. In the Input Diagram Template list, select the template for which you want to refine the diagram layer definition.
  8. Make sure the Overwrite all layers option is not checked.

    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.

  9. 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, consider the following steps:
    1. When you want to add an additional sublayer to represent system junctions in your network diagrams or reset settings existing on the corresponding network diagram sublayer, keep the System Junctions box checked.
    2. 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 get connectivity associations represented in your network diagrams, or if you want to reset settings existing on the related network diagram sublayer, keep the Connectivity Associations checked.
    3. When you configured an Add Structural Attachments rule on your template and there is no structural attachment sublayer on the diagram layer definition yet to get structural attachments represented in your network diagrams, or to reset settings for this diagram sublayer, keep Structural Attachments checked.
    4. 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 get reduction edges represented in your network diagrams, or to reset settings for this diagram sublayer, keep Reduction Edges checked.
    5. 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.
    6. 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.
    7. 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.
    8. 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.
    9. 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.
  10. Click Run.
  11. Then, 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 weighty. Then, the more weighty 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 the network diagram display performance. This customization could be done for each template to reduce the maximum number of layers. In this case, you could end with different diagram layer definitions for each of your diagram templates; each one perfectly fitting the layer requirements suitable 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 a same layer definition already exists in memory, it is automatically shared with the template currently at loading. This avoids loading a same layer definition multiple times and vainly increasing the memory footprint on the server.

This being exposed, you clearly understand that 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 so increase the memory footprint on the server since diagram layer definition cannot be shared between templates in this case.

In conclusion, while configuring your template layer definitions, you will have to strike a happy balance to limit the number of different diagram layer definitions on your templates and reduce as much as possible the number of layers for each diagram layer definition you shared between different templates.

Related topics