English

Problem: Display scale range settings for Feature Linked Annotation are lost when switching versions in the map

Description

Feature Linked Annotation layers lose display scale range settings when you change versions in ArcMap.

Cause

Known issue. ArcMap does not retain the scale values of the annotation layer.

Solution or Workaround

Define a scale range for the feature class that will be stored in the geodatabase. The bulleted items below denote different scenarios for defining feature class scale ranges.

  • Define a scale range when converting labels to annotation in ArcMap.

    a. Right click on the annotation layer and select Label Features.
    b. Right click on the annotation layer and select Properties.
    c. Switch to the Labels tab and click the Scale Range button.
    d. Select the "Don't show layer when zoomed:" radio button.
    e. Enter the minimum and maximum scale values and click OK.
    f. Click Apply and OK to dismiss the Layer Properties dialog box.
    g. Right click on the layer and select Convert Labels to Annotation.
    h. Select the "In the same database as the features and automatically linked to them" radio button under Annotation Storage Options.
    i. Click OK again to convert the labels and dismiss the dialog box.
  • Define a scale range when creating an empty annotation feature class in ArcCatalog.

    a. Right click on the feature dataset where you want to create the annotation feature class and select New > Feature Class.
    b. Select the "This feature class will store annotation features..." radio button under Type.
    c. Choose "ESRI annotation features" from the dropdown list.
    d. Check on the "Link the annotation to the following feature class" check box.
    e. Choose the feature class to link to from the dropdown list.
    f. Enter a name for the annotation feature class, then click Next.
    g. Click the Scale Range button under "Other Options".
    h. Enter the minimum and maximum scale values and click OK.
    i. Complete the feature class creation as normal.
  • Define the scale range using VBA.

    a. Add the annotation feature class to ArcMap.
    b. Drag the annotation layer to the top of the Table of Contents.
    c. Select Tools > Macros > Visual Basic Editor.
    d. Double click on Project > ArcMap Objects > ThisDocument from the Project window.
    e. Paste the following code into the code window.

    Code:
    Sub Update_Scale()
    ' this procedure updates the min/max scale thresholds
    ' for a Feature-Linked annotation feature class

    Dim mxDoc As IMxDocument
    Set mxDoc = ThisDocument
    Dim activeView As IActiveView
    Set activeView = mxDoc.ActivatedView

    Dim map As IMap
    Set map = activeView

    Dim layer As ILayer
    '*** assuming the target layer is the first layer in the map
    Set layer = map.layer(0)
    Dim fl As IFeatureLayer
    Set fl = layer

    ' Get IAnnoClassAdmin for managing the update
    Dim fc As IFeatureClass
    Set fc = fl.FeatureClass
    If Not fc.FeatureType = esriFTAnnotation Then
    MsgBox "First layer is not an annotation feature class"
    Exit Sub
    End If
    Dim afc As IAnnoClass
    Set afc = fc.Extension
    Dim afcAdmin As IAnnoClassAdmin
    Set afcAdmin = afc

    ' Get ILabelEngineLayerProperties
    Dim alpcoll As IAnnotateLayerPropertiesCollection
    Set alpcoll = afc.AnnoProperties
    Dim alp As IAnnotateLayerProperties
    alpcoll.QueryItem 0, alp

    ' Change scale and write back IAnnotateLayerPropertiesCollection
    ' Enter your own values here.
    alp.AnnotationMaximumScale = 1000
    alp.AnnotationMinimumScale = 10000
    afcAdmin.AnnoProperties = alpcoll

    ' execute update
    Dim sl As ISchemaLock
    Set sl = fc
    sl.ChangeSchemaLock esriExclusiveSchemaLock
    afcAdmin.UpdateProperties
    sl.ChangeSchemaLock esriSharedSchemaLock
    End Sub

    f. Close the Visual Basic editor.
    g. Select Tools > Customize.
    h. Switch to the Commands tab.
    i. Select Macros from the Categories list.
    j. Drag the Update_Scale macro to any tool bar.
    k. Close the Customize dialog box.
    l. Click on the new macro button to run the code.

    Note:
    The change to the scale range will only take affect in the map after you switch versions or reload the annotation.