The One To Many Labels project is for labeling features based on attribute values accessible
through one to many relationships. This functionality not yet part of the core ArcGIS software, but for now can be accomplished through this sample code.
The code requires that a query on the related objects be done before labeling each feature,
therefore performance will be slower than labeling features with attributes values in the
How to use:
Platforms: WindowsRequires: Feature data with one to many relationshipsMinimum ArcGIS Release: 9.0
- Double-click on the _Install.bat file in the code directory to register the tool. This batch
file will register the dll and add the
appropriate classes to the ESRI Annotation Expression Property Pages and ESRI Mx Annotation Expression
- Start ArcMap and add layers to the map that participate in one to many relationships (the layer
to label should be the Origin in the relationship).
- Access the Properties dialog for the layer and go to the Labels Tab. Click on the Expression button.
- Select the OneToMany tab on the Expression dialog. Select the relationship to use and the field(s)
you want to label with. If you select two fields, then the strings will be separated by " - ". The resulting
label will be stack with one line for each related record.
- Click OK to dismiss the EXpression dialog and the Properties dialog. Turn on labeling for the layer.
Download the files for all languages
||Form containing the controls for setting the labeling parameters.
||Class implementing the new expression engine for labeling.
||Class for the AnnotationExpressionParser.
||Class implementing the new property page for one to many labeling.
||Visual Basic project file.
Download the VB6 files
LabelEngineLayerProperties, RelationshipClassKey Interfaces:
IAnnotateLayerProperties, IAnnotationExpressionEngine, IAnnotationExpressionParser, IAnnotationExpressionParser2, ICodedValueAttributes, IComPropertyPage, IObjectClass, IRelationshipClass, IRowKey Members:
IAnnotateLayerProperties::FeatureLayer, IAnnotationExpressionEngine::SetExpression, IAnnotationExpressionParser2::FindLabel, IComPropertyPage::SetObjects, IComPropertyPage::Show, IObjectClass::RelationshipClasses, IRelationshipClass::GetObjectsRelatedToObject, IRow::Value