Implementing associations between GIS features and schematic features


Purpose
This sample shows how to implement associations between geographic information system (GIS) features displayed on a map and schematic features contained in a schematic diagram.
 
Two particular attributes, RelatedFeatureCN and RelatedFeatureOID, are used on the AfterLoadDiagram schematic event to automatically create the associations when an edit session is started on a diagram.
 
These attributes can be created on schematic feature classes associated with the diagram template that implements these diagrams; they must return the feature class name and ObjectID that allow you to identify the GIS feature you want associated with a schematic feature.
 
This sample is developed as an add-in ArcMap extension.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

Building the component
  1. Open the solution file and build the project. This automatically registers the component.

Configuring the RelatedFeatureCN and RelatedFeatureOID attributes on the schematic feature class
  1. Start ArcCatalog.
  2. Browse to a geodatabase that contains a schematic dataset.
  3. Right-click the schematic dataset entry and click Edit. The Schematic Dataset Editor starts.
  4. In the Dataset Editor tree window, right-click the schematic feature class entry for which you want to define an association and click New Attribute.
  5. Type RelatedFeatureCN as the attribute name.
  6. Configure the schematic attribute parameter so it returns the name of the GIS feature class that contains the desired associated GIS features.
  7. Check On Start Editing in the Evaluation mode section.
  8. Click OK. The RelatedFeatureCN attribute creation is complete.
  9. Right-click the schematic feature class entry and click New Attribute.
  10. Type RelatedFeatureOID for the attribute name.
  11. Configure the schematic attribute parameter so it returns the ObjectID of the GIS feature.
  12. Check On Start Editing in the Evaluation mode section.
  13. Click OK. The RelatedFeatureOID attribute creation is complete.
  14. Click Save on the Schematic Dataset Editor toolbar and close the Schematic Dataset Editor.

Testing the newly specified associations
  1. Start ArcMap with a new empty map.
  2. Enable the Schematic Features Associations with Geographic Features (VB .NET) or Schematic Features Associations with Geographic Features (C#) extension using the Customize>Extensions menu.
  3. Add the GIS features in the active data frame.
  4. Open a diagram containing schematic features for which new associations have been configured, or generate a diagram containing such schematic features.
  5. Start an edit session on the schematic diagram.
  6. Click the Identify tool and click any schematic feature that should be impacted by this configuration change. In the Identify window, under the schematic feature branch, a new branch shows the newly associated GIS feature.
  7. Select any schematic feature that should be impacted by this configuration change and click Propagate Schematic Selection To Map. The associated GIS feature is selected on the map.

ElementFeatureAssociation.vb Initializes the associations on the AfterLoadDiagram schematic event.
Config.esriaddinx Add-in declarations in XML.
Download the VB.NET files
ElementFeatureAssociation.cs Initializes associations on the AfterLoadDiagram schematic event.
Config.esriaddinx Add-in declarations in XML.
Download the C# files

Download the files for all languages

See Also:

ISchematicInMemoryFeatureLinkerEdit interface
AfterLoadDiagram Schematic event
ISchematicInMemoryDiagram interface
ISchematicInMemoryFeature interface




Development licensing Deployment licensing
ArcView: Schematics ArcView: Schematics
ArcInfo: Schematics ArcEditor: Schematics
ArcEditor: Schematics ArcInfo: Schematics