ArcObjects Library Reference  (Carto)    

IAnnotationFeature2 Interface

Provides access to members that control the annotation feature.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Description
Read/write property Annotation The annotation element for the feature.
Read/write property AnnotationClassID Label Class ID.
Read/write property LinkedFeatureID Feature ID.
Read/write property Status The current status of the annotation.

CoClasses that implement IAnnotationFeature2

CoClasses and Classes Description
AnnotationFeature An ESRI annotation feature.

Remarks

The IAnnotationFeature interface is used for relating annotation features to other features or updating the graphic of the annotation. The Annotation property will accept any object implementing IGraphicElement.  If a TextElement is used, you may reference an exiting TextSymbol stored in the SymbolCollection of the AnnotationFeatureClassExtension by using the ISymbolCollectionElement interface.  It is highly recommended that you reference symbols in the SymbolCollection when storing TextElements in an annotation feature class.  See the help for ISymbolCollectionElement for more details on this storage system.

The LinkedFeatureID property is used to indicate which feature the annotation is linked to for feature-linked annotation.  If the feature is not linked, the property will be -1.

The AnnotationClassID property indicated which annotation class the annotation feature belogs to.  An Annotation Feature Class may have have multiple Annotation Classes.

The Status property indicated whether or not the annotation feature is considered Placed or Unplaced.  Unplaced annotation is not drawn by default.

After updating the either of these properties, the IFeature::Store method must be called.

[Visual Basic 6.0]

The following code sample demonstrates how to update the text of an AnnotationFeature:

Public Sub UpdateText(pAnnoFeature As IAnnotationFeature2)
  Dim pElement As IElement
  Set pElement = pAnnoFeature.Annotation
   
  If TypeOf pElement Is ISymbolCollectionElement Then
    'use ISymbolCollectionElement for efficient annotation updates editing
    Dim pSymbolCollectionElement As ISymbolCollectionElement
    Set pSymbolCollectionElement = pElement
    pSymbolCollectionElement.Text = "Foo"
    pAnnoFeature.Annotation = pElement
    Dim pFeature As IFeature
    Set pFeature = pAnnoFeature
    pFeature.Store
  End If
End Sub

See Also

IFeature Interface | IFeatureCursor Interface

 


Feedback Send feedback on this page