Rotate Symbol



Description:

This sample code is designed to automatically rotate point symbols based on the line feature they are snapped to. The point features being added must have symbol rotation turned on for the extension to work correctly.
Products:
ArcView: VB6

Platforms: Windows

Requires: An Edit Session.

Minimum ArcGIS Release: 9.0

How to use:
  1. Register the dll on your machine.
  2. Run Categories.exe and register the dll under the 'ESRI Editor Extensions' component category.
  3. Start ArcMap and add line and point data to the map.
  4. If you have not already done so, set the symbology for your point layer to support rotation by a field (select the Advanced->Rotation option when setting your point symbology and specify the field to hold the rotation angle).
  5. Start editing and set your snapping environment to include snapping to the edges of your line layer.
  6. Add a new feature to your point layer and snap it to the line layer. The symbol should automatically rotate to match the orientation of the line.

Download the VB6 files
RotateSymbol.cls Class file containing symbol rotation code.

Download the files for all languages



Key CoClasses:FeatureSnap, SimpleRenderer
Key Interfaces: IFeatureSnapAgent, IRotationRenderer, ISegment
Key Members:IFeatureSnapAgent::HitType, IFeatureSnapAgent::FeatureCache, IRotationRenderer::RotationField, ISegment::FromPoint, ISegment::ToPoint