Summary
Updates the input annotation feature class with text attribute fields and optionally populates the value of each new field for every feature in the feature class.
Usage
This tool can be run on a versioned feature class if the option to populate attribute fields is unchecked. The schema of the feature class will be updated in this case, but the new annotation fields will not be populated. Attribute values for a feature will remain blank until the feature is edited.
This tool will update the schema of the feature class and, optionally, each annotation feature within the feature class. The schema update will add fields to the feature class (bold, italic, text, and so on) and also ensure that there is a symbol within the symbol collection. Without a symbol in the symbol collection, you can't use the improvements for constructing annotation features.
Populating the attributes fields is an intensive operation that requires every feature to be updated. Turning off this option will add the fields, but not populate them. If the fields are not populated on update, they will remain blank until the feature is edited.
Syntax
UpdateAnnotation_management (in_features, {update_values})
Parameter | Explanation | Data Type |
in_features | Input annotation feature class to which new fields will be added. | Feature Layer |
update_values (Optional) | Populates the value of each new field for every feature in the feature class.
| Boolean |
Code sample
UpdateAnnotation Example (Python Window)
The following Python Window script demonstrates how to use the UpdateAnnotation tool in immediate mode.
import arcpy
arcpy.env.workspace = "C:/data/Ontario.mdb"
arcpy.UpdateAnnotation_management("ProvParks_anno", "POPULATE")
UpdateAnnotation Example (Stand-alone python script)
The following stand-alone script demonstrates how to use the UpdateAnnotation tool.
# Name: UpdateAnnotation_Example.py
# Description: Use UpdateAnnotation to update ArcGIS 8.3 annotation feature classes
# to ArcGIS 9.0
# import system modules
import arcpy
import os
# Set environment settings
# User input geodatabase location - eg. C:/data/anno83.mdb
arcpy.env.workspace = input('Annotation data location: ')
# Create list of annotation feature classes within the geodatabase
fcList = arcpy.ListFeatureClasses("", "ANNOTATION")
# Loop through the feature classes and update
for fc in fcList:
try:
# Process: Update the annotation feature classes
print("Updating " + fc + "...")
arcpy.UpdateAnnotation_management(fc, "POPULATE")
except:
# If an error occurred while running a tool print the messages
print(arcpy.GetMessages())
print("Update of annotation feature classes in " + env.workspace + " complete")
Environments
Licensing information
- ArcGIS for Desktop Basic: Yes
- ArcGIS for Desktop Standard: Yes
- ArcGIS for Desktop Advanced: Yes