Feature Linked Annotation Behavior

12-29-2016 03:16 PM
New Contributor II

I am under the impression that when feature linked annotation is created for a feature class that after an attribute that was included in the original label expression is changed / updated that the annotation and its associated label would be updated to reflect the attribute change.  Am I wrong in assuming this?  From the help documentation it states that it should.

I am using Desktop 10.4.1 with an ArcEditor license with a feature class in a file geodatabase.  I created a label expression using python as the parser that uses 3 fields to build a stacked label with some conditional formatting.  I've been right-clicking the feature class and storing the annotation in a database for all features and made sure that feature linked is checked.

If I go into the original feature class that the annotation was created from and edit one of the fields associated with the label expression I don't see the text updating in the annotation class TextString field or the label itself.

Is there a setting that may be preventing the update?  I came across a few threads mentioning that SQL queries could be causing an issue.  I haven't used any or a definition query on any of the layers.  I've tried it with a new feature class with a single point feature and 3 attributes and still haven't seen it update.

Any help is appreciated

0 Kudos
7 Replies
Regular Contributor II

It is related to Feature Linked , that is when you create annotation

IF feature Linked checked that is mean any update in feature class will update the annotation at the same time.

IF not checked , Annotation will be not changed even if you change the data of feature class.

0 Kudos
Regular Contributor II

Using Feature linked , is for update attribute in feature class , make the annotation attribute updated too.

but it isn't for label expression .

if you update label expression after you create annotation with Feature linked, The label of annotation will still not changed.

If you want to change  label expression , make that for annotation layer -annotation stay has all feature attribute-  and not for feature class .

New Contributor III

I found a work around, but it's a little cumbersome.

  1. Open Arc Catalog
  2. Edit the expression in the Annotation Properties
  3. Open ArcMap
  4. Perform an edit on all the features in the feature class
    1. the change won't populate on a feature unless an edit is performed on it
    2. I did a field calculation on an empty field changing NULL to "None"
  5. Each new feature, and any that you do an edit on will have the new changes.
Regular Contributor

Helpful post, Keith. Apparently ArcMap does not display annotation from the TextString field. The TextString field is probably read when updates are made to the actual annotation data store.

What we are trying to do is get ArcMap to update the real annotation data store with the contents of the TextString field. One clarification - the modification that triggers the update must be to the TextString field. For example, run the field calculator and and a "1" to the end of every string (during an edit session). At this point the annotation should be updated. Then use the field calculator and an appropriate code snippet to remove the 1.

0 Kudos
New Contributor III

I'd like to share how I solved this, because it was also frustrating me that the TextString field of a FeatureLinked Annotation was not updating when the related feature class attributes that the label expression was based on were changed. ESRI's documentation on this is very convoluted, but in the end I came up with a pretty easy fix. 

In the map

  1. Unlink the annotation from the labels it was originally based on
  2. Set the original feature class to display labels again
  3. Check to make sure that the content of the new labels matches your updated data (don't worry about label placement)
  4. Convert the new labels to a new feature-linked annotation layer (this layer will be temporary)
  5. Right click on the original annotation layer and add a join to the new annotation layer based on the FeatureID
  6. Start editing and set the TextString of the original annotation class to equal the TextString value to the new, temporary annotation class.
  7. Save the edits, remove the join and remove the temporary annotation class layer.
  8. Your annotations should be updated with all the placement still in place.
0 Kudos
New Contributor

The run-time environment for label expressions in feature-linked annotation seems to be slightly different than in feature-class labels such that the label expression may crash and fail to update the annotation text string, whereas it runs just fine in a feature-class label.  I discovered this behavior when annotation from my latest label expression  did not update, whereas an earlier version worked as advertised by ESRI.  The latest version is in Python rather than VBA, and I probably did something questionable during translation from the earlier version.  It's not just a Python thing; I made simple label expressions in both Python and VBA, and feature-linked annotation based on each exhibited the expected on-the-fly updating.

Regarding the original poster's problem, I suspect that data-type coercion in the two environments is not identical for Python, and the solution may be to explicitly convert all parameters to UTF-8 strings before doing anything else with them.

0 Kudos
New Contributor

Digging deeper, there appears to be a problem initializing lists in Python at runtime in feature-linked annotation.  For me, the following code updates the annotation text string:

def FindLabel ([SampleID],[Benzoaanthracene]):
  aNames = "Benzo(a)anthracene"
  SampleIDLocal = str([SampleID])
  TheLabel = SampleIDLocal + ' ' + aNames + ' = ' + str([Benzoaanthracene])
  return TheLabel

Whereas initializing aNames as an empty list results in static annotation:

def FindLabel ([SampleID],[Benzoaanthracene]):
  aNames = []
  SampleIDLocal = str([SampleID])
  TheLabel = SampleIDLocal + ' Benzo(a)anthracene = ' + str([Benzoaanthracene])
  return TheLabel

Even stranger, when I commented out the offending line (#aNames = []), annotation was still static.  On the off chance that aNames is somehow a reserved word, I changed it to arrayNames (still static) and then gibberish (alkghowish, which worked!).  Changing to aDspNam = [] also worked until I actually tried to populate the list.

Given this unpredictable behavior, I am going to return to using VBA for label expressions.

0 Kudos