Direction Constraint


The Direction Constraint is a custom sketch context menu item that allows you to constrain the edit sketch in a particular direction. The Direction Constraint Tool can be used independently, but is designed to work with the the Coordinate Geometry extension. The tool uses the current direction type setting in the COGO Properties dialog.

How to use:
  1. If the entire Coordinate Geometry sample has been installed using the _INSTALL.BAT the next step is not required.
  2. Register the DirectionConstraint.dll on your machine. Browse and select the DirectionConstraint.dll using the 'Add From File' button on the Customize dialog.
  3. From the 'Developer Samples' commands category, add the Direction...' command to the Sketch tool context menu.
  4. Start an edit session and set the target layer to a polyline or polygon feature layer. Use the sketch tool to create an edit sketch with at least one vertex.
  5. Right click anywhere on the map and click on the 'Direction...' tool from the 'Sketch Tool Context Menu'.
  6. Set the direction to constrain the sketch in. If the Coordinate Geometry extension is being used, the direction type and units are set on the 'COGO' tab of the editor options.


Requires: An edit session.

Difficulty: Intermediate

Visual Basic
File Description
clsDirectionConstraint.cls VB class file containing the IEditTask implementation.
frmDirectionConstraint.frm Form for setting the direction to constrain the sketch.
clsDirection.cls VB class file containing common COGO functions. Note - This class file is used by several projects so is located in the ..\COGOUtilities folder.
clsCOGOEnum.cls VB class file containing common COGO enumerations. Note - This class file is used by several projects so is located in the ..\COGOUtilities folder.
DirectionConstraint.vbp The project file for the sample sketch tool.
DirectionConstraint.dll The compiled project.

Key CoClasses: Editor
Key Interfaces: IEditSketch, ISketchTool
Key Members: ISketchTool::Constraint