I have annotation where a single annotation feature consists of one or more TextElements and RectangleElements grouped together in a GroupElement and then stored in the annotation feature. To edit the contents of the annotation feature later, it would be nice to be able to know which elements are related to each other. The elements have natural groupings, but those groups cannot be grouped together and then grouped into the final GroupElement for storage. Due to a bug, the ESRI optimized map service cannot handle nested groups in annotation. (See this posting.) So all elements just have to be thrown in together. An identifier object, holding, say, a group name string, attached to each element would make identification of elements belonging to each subgroup much easier to identify. The Avenue ObjectTag object in old ArcView GIS 3.x (I guess it was a property) used to be great for such things. You could stick a tag on just about any object in the whole model, including dialog controls. Really handy. I haven't thought about this -- until recently -- since the old Avenue days, but it has now come to my consciousness again. I haven't been able to find anything like the old ObjectTag in ArcObjects. Any ideas?
I guess the most direct equivalent in ArcObjects would be
CustomProperty is a place for developers to attach custom objects to an element. Previous versions of the software required that the specified variant be of type
VT_UNKNOWN, i.e. a reference to an object, but that requirement has since been removed. Now, the CustomProperty can also be a simple type like an integer, double, boolean (
VARIANT_BOOL) or a string (
When this property is an object reference, the object must implement a persistence interface, so if you write a custom object it must implement
IPersistVariant. As an alternative to writing a custom object, you can use a
XMLPropertySet, since they both already implement
CustomProperty is never used by the core ArcObjects for its own elements, but the core software will expect to find an
IPersistVariantinterface when the this property is an object reference, and it is part of an element being retrieved from or stored in an .mxd file.