Add Compression Layout (Network Diagram)

Summary

Adds the Compression Layout algorithm to the layout list of the input diagram template so it automatically executes at the end of diagram buildings. This tool also presets the Compression Layout algorithm parameters for any diagram based on that template.

This layout algorithm compresses the diagram features toward the middle of the diagram while trying to maintain relative positioning. It works from a distance that allows it to build junction groups that are moved as super nodes during the algorithm execution.

Learn more about the Compression layout algorithm

Caution:

This tool is a configuration and administration tool.

Note:

This tool impacts the consistency of any existing diagrams based on the input diagram template. All of the existing diagrams become inconsistent and open with a consistency warning icon May be inconsistent until they are updated.

Usage

  • This tool is not supported when working with a utility network service. You must work with either a utility network or trace network in a file geodatabase or a database connection to a utility network in an enterprise geodatabase. When working with an enterprise geodatabase, the connection must be established as the database utility network owner.

  • When performing this operation on a utility network in an enterprise geodatabase, the connected ArcGIS Enterprise portal account must be the portal utility network owner.

  • The network data element specified for the input network parameter must be from either a utility network or trace network in a file geodatabase or a database connection to a utility network in an enterprise geodatabase.

  • To preset the layout algorithm parameters for any diagram based on the diagram template, uncheck the Active parameter (is_active = "INACTIVE" in Python).

  • Run the tool with Active checked (the default) (is_active = "ACTIVE" in Python) if you want the layout algorithm to be added to the list of layouts that will be automatically chained at the end of diagram generation based on the input diagram template.

Syntax

AddCompressionLayout(in_utility_network, template_name, is_active, {are_containers_preserved}, {grouping_distance_absolute}, {vertices_removal_rule})
ParameterExplanationData Type
in_utility_network

The utility network or trace network containing the diagram template to modify.

Utility Network; Trace Network
template_name

The name of the diagram template to modify.

String
is_active

Specifies whether the layout algorithm will automatically execute when generating diagrams based on the specified template.

  • ACTIVEThe added layout algorithm will automatically run during the generation of any diagram that is based on the template_name parameter. This is the default.The parameter values specified for the layout algorithm are used to run the layout during diagram generation. They are also loaded by default when the algorithm is to be run on any diagram based on the input template.
  • INACTIVEAll the parameter values currently specified for the added layout algorithm will be loaded by default when the algorithm is to be run on any diagram based on the input template.
Boolean
are_containers_preserved
(Optional)

Specifies how containers will be processed by the Compression layout algorithm.

  • PRESERVE_CONTAINERS The Compression layout algorithm will execute on the top graph of the diagram so containers are preserved. This is the default.
  • IGNORE_CONTAINERSThe Compression layout algorithm will execute on both content and noncontent features in the diagram.
Boolean
grouping_distance_absolute
(Optional)

The grouping distance is used to determine whether two connected junctions are close enough to be considered part of the same junctions group. A junctions group represents many junctions that are moved as a group during execution. The group can contain both junctions and containers. To group two junctions, they must also be connected in the diagram by an edge. The default is 20 units in the diagram's coordinate system.

Linear Unit
vertices_removal_rule
(Optional)

Specifies which vertices along edges in the diagram will be removed.

  • ALLAll vertices on all edges will be removed from the diagram.
  • OUTERAny edge vertices that are within the detected junctions' groups will be maintained, while edge vertices that are outside will be removed.When there are containers in the diagram that have edges that intersect the container polygons, a vertex is added at the intersection of the edge and container polygon. This is the default.
  • OUTER_EXCEPT_FIRSTAny edge vertices that are within the detected junctions' groups will be maintained, while edge vertices that are outside will be removed.When there are containers in the diagram that have edges that intersect the container polygons, the first (or last) outside vertex is preserved on edges that intersect a container polygon. A vertex is automatically inserted at the intersection of the edges and container polygons.
String

Derived Output

NameExplanationData Type
out_utility_network

The updated utility network or trace network.

Utility Network; Trace Network
out_template_name

The name of the diagram template.

String

Code sample

AddCompressionLayout example (Python window)

Add the Compression layout algorithm as an automatic layout to the MyTemplate1 template existing for a given network.

import arcpy
input_Network = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
input_DiagramTemplate = "MyTemplate1"

arcpy.AddCompressionLayout_nd(input_Network, input_DiagramTemplate, "ACTIVE", 
                              "PRESERVE_CONTAINERS", "20 Feet", "OUTER")

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics