ArcGIS Pro 2.9 API Reference Guide
AnnotationFeatureClassDescription Constructor(String,IReadOnlyList<FieldDescription>,ShapeDescription,CIMGeneralPlacementProperties,List<CIMLabelClass>,FeatureClassDescription)
Example 

ArcGIS.Core.Data.DDL Namespace > AnnotationFeatureClassDescription Class > AnnotationFeatureClassDescription Constructor : AnnotationFeatureClassDescription Constructor(String,IReadOnlyList<FieldDescription>,ShapeDescription,CIMGeneralPlacementProperties,List<CIMLabelClass>,FeatureClassDescription)
The name of the description.
The list of fields for the ArcGIS.Core.Data.Mapping.AnnotationFeatureClass.
The description for the shape ArcGIS.Core.Data.Field.
The general placement properties for the annotation.
The label classes for the annotation.
The ArcGIS.Core.Data.FeatureClass that will have linked features with this ArcGIS.Core.Data.Mapping.AnnotationFeatureClass.
Creates a description object of the ArcGIS.Core.Data.Mapping.AnnotationFeatureClass.
Syntax

Parameters

name
The name of the description.
fieldDescriptions
The list of fields for the ArcGIS.Core.Data.Mapping.AnnotationFeatureClass.
shapeDescription
The description for the shape ArcGIS.Core.Data.Field.
generalPlacementProperties
The general placement properties for the annotation.
labelClasses
The label classes for the annotation.
linkedFeatureClassDescription
The ArcGIS.Core.Data.FeatureClass that will have linked features with this ArcGIS.Core.Data.Mapping.AnnotationFeatureClass.
Exceptions
ExceptionDescription

name and/or fieldDescriptions is invalid.

-or-

shapeDescription must have ArcGIS.Core.Geometry.GeometryType.Polygon.

-or-

There must be at least one ArcGIS.Core.CIM.CIMLabelClass, and the list must have unique names and IDs. Each must also have a ArcGIS.Core.CIM.CIMLabelClass.TextSymbol.

fieldDescriptions, shapeDescription, generalPlacementProperties, labelClasses, and/or linkedFeatureClassDescription is null.
Example
// Creating a feature-linked annotation feature class between water pipe and valve in water distribution network
// with following user defined fields
// PipeName 
// GlobalID

// Annotation feature class name
string annotationFeatureClassName = "WaterPipeAnnotation";

// Create user defined attribute fields for annotation feature class
FieldDescription pipeGlobalID = FieldDescription.CreateGlobalIDField();
FieldDescription nameFieldDescription = FieldDescription.CreateStringField("Name", 255);

// Create a list of all field descriptions
List<FieldDescription> fieldDescriptions = new List<FieldDescription> { pipeGlobalID, nameFieldDescription };

// Create a ShapeDescription object
ShapeDescription shapeDescription = new ShapeDescription(GeometryType.Polygon, spatialReference);

// Create general placement properties for Maplex engine 
CIMMaplexGeneralPlacementProperties generalPlacementProperties = new CIMMaplexGeneralPlacementProperties
{
  AllowBorderOverlap = true,
  PlacementQuality = MaplexQualityType.High,
  DrawUnplacedLabels = true,
  InvertedLabelTolerance = 1.0,
  RotateLabelWithDisplay = true,
  UnplacedLabelColor = new CIMRGBColor
  {
    R = 255,
    G = 0,
    B = 0,
    Alpha = 0.5f 
  }
};

// Create annotation  label classes
// Green label
CIMLabelClass greenLabelClass = new CIMLabelClass
{
  Name = "Green",
  ExpressionTitle = "Expression-Green",
  ExpressionEngine = LabelExpressionEngine.Arcade,
  Expression = "$feature.OBJECTID",
  ID = 1,
  Priority = 0,
  Visibility = true,
  TextSymbol = new CIMSymbolReference
  {
    Symbol = new CIMTextSymbol()
    {
      Angle = 45,
      FontType = FontType.Type1,
      FontFamilyName = "Tahoma",
      FontEffects = FontEffects.Normal,
      HaloSize = 2.0,

      Symbol = new CIMPolygonSymbol
      {
        SymbolLayers = new CIMSymbolLayer[]
        {
          new CIMSolidFill
          {
            Color = CIMColor.CreateRGBColor(0, 255, 0)
          }
        },
        UseRealWorldSymbolSizes = true
      }
    },
    MaxScale = 0,
    MinScale = 0,
    SymbolName = "TextSymbol-Green"
  },
  StandardLabelPlacementProperties = new CIMStandardLabelPlacementProperties
  {
    AllowOverlappingLabels = true,
    LineOffset = 1.0
  },
  MaplexLabelPlacementProperties = new CIMMaplexLabelPlacementProperties
  {
    AlignLabelToLineDirection = true,
    AvoidPolygonHoles = true
  }
};

// Blue label
CIMLabelClass blueLabelClass = new CIMLabelClass
{
  Name = "Blue",
  ExpressionTitle = "Expression-Blue",
  ExpressionEngine = LabelExpressionEngine.Arcade,
  Expression = "$feature.OBJECTID",
  ID = 2,
  Priority = 0,
  Visibility = true,
  TextSymbol = new CIMSymbolReference
  {
    Symbol = new CIMTextSymbol()
    {
      Angle = 45,
      FontType = FontType.Type1,
      FontFamilyName = "Consolas",
      FontEffects = FontEffects.Normal,
      HaloSize = 2.0,

      Symbol = new CIMPolygonSymbol
      {
        SymbolLayers = new CIMSymbolLayer[]
        {
          new CIMSolidFill
          {
            Color = CIMColor.CreateRGBColor(0, 0, 255)
          }
        },
        UseRealWorldSymbolSizes = true
      }
    },
    MaxScale = 0,
    MinScale = 0,
    SymbolName = "TextSymbol-Blue"
  },
  StandardLabelPlacementProperties = new CIMStandardLabelPlacementProperties
  {
    AllowOverlappingLabels = true,
    LineOffset = 1.0
  },
  MaplexLabelPlacementProperties = new CIMMaplexLabelPlacementProperties
  {
    AlignLabelToLineDirection = true,
    AvoidPolygonHoles = true
  }
};

// Create a list of labels
List<CIMLabelClass> labelClasses = new List<CIMLabelClass> { greenLabelClass, blueLabelClass };


// Create linked feature description
// Linked feature class name
string linkedFeatureClassName = "WaterPipe";

// Create fields for water pipe
FieldDescription waterPipeGlobalID = FieldDescription.CreateGlobalIDField();
FieldDescription pipeName = FieldDescription.CreateStringField("PipeName", 255);

// Create a list of water pipe field descriptions
List<FieldDescription> pipeFieldDescriptions = new List<FieldDescription> { waterPipeGlobalID, pipeName };

// Create a linked feature class description
FeatureClassDescription linkedFeatureClassDescription = new FeatureClassDescription(linkedFeatureClassName, pipeFieldDescriptions,
  new ShapeDescription(GeometryType.Polyline, spatialReference));
      
// Create a SchemaBuilder object
SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);

// Add the creation of the linked feature class to the list of DDL tasks
FeatureClassToken linkedFeatureClassToken = schemaBuilder.Create(linkedFeatureClassDescription);

// Create an annotation feature class description object to describe the feature class to create
AnnotationFeatureClassDescription annotationFeatureClassDescription =
  new AnnotationFeatureClassDescription(annotationFeatureClassName, fieldDescriptions, shapeDescription,
    generalPlacementProperties, labelClasses, new FeatureClassDescription(linkedFeatureClassToken))
  {
    IsAutoCreate = true,
    IsSymbolIDRequired = false,
    IsUpdatedOnShapeChange = true
  };

// Add the creation of the annotation feature class to the list of DDL tasks
schemaBuilder.Create(annotationFeatureClassDescription);

// Execute the DDL
bool success = schemaBuilder.Build();

// Inspect error messages
if (!success)
{
  IReadOnlyList<string> errorMessages = schemaBuilder.ErrorMessages;
  //etc.
}
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

AnnotationFeatureClassDescription Class
AnnotationFeatureClassDescription Members
Overload List