ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / SchemaBuilder Class / Create Method / Create(FeatureDatasetDescription,AnnotationFeatureClassDescription) Method
Indicates the ArcGIS.Core.Data.FeatureDataset where the ArcGIS.Core.Data.Mapping.AnnotationFeatureClass will be created.
Indicates the ArcGIS.Core.Data.Mapping.AnnotationFeatureClass to be created.
Example Version

Create(FeatureDatasetDescription,AnnotationFeatureClassDescription) Method
Enqueue the create operation on the object referred to by the AnnotationFeatureClassDescription. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
Exceptions
ExceptionDescription

The ArcGIS.Core.Geometry.SpatialReference of the featureDatasetDescription and the annotationFeatureClassDescription do not match.

-or-

The total path length for the ArcGIS.Core.Data.Mapping.AnnotationFeatureClass to be created must be less than 252 characters.

-or-

The annotation symbols are invalid.

featureDatasetDescription and/or annotationFeatureClassDescription is null.
Memory ArcGIS.Core.Data.Geodatabase does not support feature datasets.
This method or property must be called within the lambda passed to QueuedTask.Run.
Remarks
Example
Creating an annotation feature class inside feature dataset
public void CreateAnnotationFeatureClassUsingExistingAnnotationFeatureClassInDataset(Geodatabase geodatabase)
{
    // Create a Cities annotation feature class inside Places feature dataset using existing annotation feature class 

    // Feature dataset name
    string featureDatasetName = "Places";

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

    // Create a SchemaBuilder object
    SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);

    // Open existing annotation feature class name
    using (AnnotationFeatureClass existingAnnotationFeatureClass = geodatabase.OpenDataset<AnnotationFeatureClass>("ExistingAnnotationFeatureClass"))
    {

        // Create Feature dataset description
        FeatureDatasetDescription featureDatasetDescription =
          new FeatureDatasetDescription(featureDatasetName, existingAnnotationFeatureClass.GetDefinition().GetSpatialReference());

        // Add the creation of the Places dataset to DDL task
        FeatureDatasetToken featureDatasetToken = schemaBuilder.Create(featureDatasetDescription);

        // Create an annotation feature class description using existing annotation feature class
        AnnotationFeatureClassDescription annotationFeatureClassDescription = new AnnotationFeatureClassDescription(annotationFeatureClassName, existingAnnotationFeatureClass.GetDefinition())
        {
            IsAutoCreate = true,
            IsSymbolIDRequired = false,
            IsUpdatedOnShapeChange = true
        };

        // Add the creation of the Cities annotation feature class inside Places feature dataset
        schemaBuilder.Create(new FeatureDatasetDescription(featureDatasetToken), 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

ArcGIS Pro version: 3 or higher.
See Also