Auto Shapes

Created:11/11/1999
Description:

The AutoShapes sample illustrates how you can create new geographic features using pre-defined shapes. There are three tools in one Visual Basic project. Each has the same look and feel as the Rectangle, Circle, and Ellipse Tools located on the Drawing toolbar.

How to use:
  1. Browse and select the Autoshapes.dll using the 'Add From File' button on the Customize dialog.
  2. From the 'Developer Samples' commands category, add 'Circle Tool', 'Ellipse Tool', and 'Rectangle Tool' to the Editor toolbar.
  3. Start an edit session with at least one polyline or polygon feature class loaded into the map.
  4. Set the target layer to the polyline or polygon layer in which you wish to create a new feature.
  5. Using the desired tool, drag an envelope on the display to create a new feature.

Application:
ArcMap

Requires: An edit session with a polyline or polygon feature class.

Difficulty: Advanced


Visual Basic
File Description
Resources.frm Form that contains bitmaps for the tools.
RectangleTool.cls Class file that implements ICommand to create the Rectangle Tool.
CircleTool.cls Class file that implements ICommand to create the Circle Tool.
EllipseTool.cls Class file that implements ICommand to create the Ellipse Tool.
Autoshapes.vbp The project file for all tools.
Autoshapes.dll The compiled project.


Key CoClasses: Editor, NewLineFeedback
Key Interfaces: IEditSketch, INewLineFeedback, IConstructEllipticArc, ISegmentCollection
Key Members: IEditSketch::Geometry, IEditSketch::FinishSketch, IConstructEllipticArc::ConstructEnvelope, ISegmentCollection::SetCircle