ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Editing Namespace / AnnotationProperties Class / Shape Property
Example

In This Topic
    Shape Property (AnnotationProperties)
    In This Topic
    Gets and sets the text baseline shape.
    Syntax
    Public Property Shape As Geometry
    public Geometry Shape {get; set;}
    Remarks
    The shape geometry represents the reference point or line for the annotation. Supported geometry types include point, line, multipoint and geometryBag.
    Example
    Modify Annotation Shape
    // Modifies the geometry of an annotation feature in the specified annotation layer.
    await QueuedTask.Run(() =>
    {
      //Don't use 'Shape'....Shape is the bounding box of the annotation text. This is NOT what you want...
      //
      //var insp = new Inspector();
      //insp.Load(annotationLayer, objectId);
      //var shape = insp["SHAPE"] as Polygon;
      //...wrong shape...
      //Instead, we must use the AnnotationProperties
      //annotationLayer is ~your~ Annotation layer
      var insp = new Inspector();
      insp.Load(annotationLayer, objectId);
      AnnotationProperties annoProperties = insp.GetAnnotationProperties();
      var shape = annoProperties.Shape;
      if (shape.GeometryType != GeometryType.GeometryBag)
      {
        var newGeometry = GeometryEngine.Instance.Move(shape, 10, 10);
        annoProperties.Shape = newGeometry;
        insp.SetAnnotationProperties(annoProperties);
        EditOperation op = new EditOperation
        {
          Name = "Change annotation angle"
        };
        op.Modify(insp);
        if (!op.IsEmpty)
        {
          var result = op.Execute(); //Execute and ExecuteAsync will return true if the operation was successful and false if not
        }
      }
    });
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also