Set Layer Representation (Cartography)
Summary
Sets a representation for a feature layer. The layer is temporary and stored in memory during the ArcGIS session, available for use in models and scripts.
Usage
-
The input must be a geodatabase feature class with at least one feature class representation.
-
The resulting layer can be used as a valid input for cartographic tools that require a layer input in especially in models and scripts.
-
The temporary feature layer can be saved as a layer file using the Save To Layer File tool or saved as a new feature class using the Copy Features tool. Layers created in ArcCatalog cannot be used in ArcMap unless they are saved to a layer file using the Save To Layer File tool.
Syntax
Parameter | Explanation | Data Type |
in_layer |
The input feature layer containing at least one representation. | Layer |
representation |
The representation to be set for the input feature layer. | String |
Code Sample
The following Python window script demonstrates how to use the SetLayerRepresentation tool in immediate mode.
import arcpy from arcpy import env env.workspace = "C:/data" arcpy.SetLayerRepresentation_cartography("footprints.lyr", "buildings_Rep")
This stand-alone script shows an example of using the SetLayerRepresentation tool.
# Name: SetLayerRepresentation_standalone_script.py # Description: Sets a representation for a feature layer. The layer is temporary and stored in memory for use in models and scripts. # Import system modules import arcpy from arcpy import env # Set environment settings env.workspace = "C:/data" # Set local variables in_features = "footprints.lyr" representation = "buildings_Rep" # Execute Set Layer Representation arcpy.SetLayerRepresentation_cartography(in_features, representation)