Add Representation (Cartography)

License Level:BasicStandardAdvanced

Summary

Adds a feature class representation to a geodatabase feature class.

Usage

Syntax

AddRepresentation_cartography (in_features, representation_name, {rule_id_field_name}, {override_field_name}, {geometry_editing_option}, {import_rule_layer}, {assign_rule_id_option})
ParameterExplanationData Type
in_features

The input geodatabase feature class to which a new feature class representation will be added.

Feature Layer
representation_name

The name of the feature class representation to be added.

String
rule_id_field_name
(Optional)

The name of the RuleID field, which will hold a reference to the representation rule for each feature.

String
override_field_name
(Optional)

The name of the Override field, which will hold overrides to representation rules for each feature.

String
geometry_editing_option
(Optional)

Specifies what will happen to the supporting feature class geometry when features are modified with the representation editing tools.

  • STORE_CHANGE_AS_OVERRIDEGeometry modification made to features with the representation editing tools or using any of the geoprocessing tools in the Cartography toolbox will be stored as shape overrides in the Override field. Supporting feature class geometry (stored in the Shape field of the feature class) will be unaffected. This is the default.
  • MODIFY_FEATURE_SHAPEGeometry modifications made to features with the representation editing tools, or using any of the geoprocessing tools in the Cartography toolbox, will modify the supporting feature class geometry (stored in the Shape field of the feature class.) No shape overrides will be stored.
String
import_rule_layer
(Optional)

A feature layer that symbolizes features with a feature class representation, from which the representation rules are imported.

Layer
assign_rule_id_option
(Optional)

Specifies whether or not to assign representation rules to features to match the RuleID assignments of the import rule layer. This option applies only when Import Rule Layer is specified.

  • ASSIGNassign RuleIDs to features to match the import rule layer. This is the default.
  • NO_ASSIGNSpecifies not to match RuleIDs to features from the import rule layer. Features will be assigned to the default representation rule instead.
String

Code Sample

AddRepresentation tool Example (Python Window)

The following Python window script demonstrates how to use the AddRepresentation tool in immediate mode.

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.AddRepresentation_cartography("C:/data/cartography.gdb/buildings/footprints",
                                    "footprints_Rep", "RuleID", "Override",
                                    "STORE_CHANGE_AS_OVERRIDE", "C:/data/footprints.lyr", "ASSIGN")
AddRepresentation tool Example (stand-alone Python script)

This stand-alone script shows an example of using the AddRepresentation tool.

# Name: AddRepresentation_standalone_script.py
# Description: Adds a feature class representation
#              to a geodatabase feature class.
 
# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# Set local variables
in_features = "C:/data/cartography.gdb/buildings/footprints"
representation_name = "footprints_Rep"
rule_id_field_name = "RuleID"
override_field_name = "Override"
geometry_editing_option = "STORE_CHANGE_AS_OVERRIDE"
import_rule_layer = "C:/data/footprints.lyr"
assign_rule_id_option = "ASSIGN"

# Execute Add Representation
arcpy.AddRepresentation_cartography(in_features,
                                    representation_name,
                                    rule_id_field_name,
                                    override_field_name,
                                    geometry_editing_option,
                                    import_rule_layer,
                                    assign_rule_id_option)

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: No
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
3/3/2014