ArcGIS Pro 3.3 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 Geometry Shape {get; set;}
    Public Property Shape As Geometry
    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
    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(annoLayer, oid);
      //var shape = insp["SHAPE"] as Polygon;
      //...wrong shape...
    
      //Instead, we must use the AnnotationProperties
    
      //annoLayer is ~your~ Annotation layer
      //at 2.x - var insp = new Inspector(true);
      var insp = new Inspector();
      insp.Load(annoLayer, oid);
    
      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();
        op.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, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also