This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Editor > ESRI.ArcGIS.Editor > Interfaces > IS > ISketchTool Interface (ArcObjects .NET 10.5 SDK) |
Provides access to members that control the main sketch tool.
Description | ||
---|---|---|
AddPoint | Adds a point to the sketch. | |
Anchor | The anchor of the sketch. | |
AngleConstraint | The sketch's angular constraint. | |
Constraint | The sketch constraint. | |
DistanceConstraint | The sketch's distance constraint. | |
IsStreaming | Indicates whether stream mode digitizing is enabled. | |
Location | The current location of the mouse. |
The SketchTool object is the default sketch tool on the Editor toolbar. This sketch tool has its own context menu with commands such as Direction, Distance, and Parallel. Add your own custom commands or macros to the Sketch Tool context menu using the Customize dialog box.
Use ISketchTool when you want to set and get specific information about the Sketch tool. For example, when creating a custom Sketch tool menu item, you may need to get the Sketch tool�s current location or the edit sketch anchor point. For example, the Parallel command uses the Location property to find the feature on which the sketch tool was rightclicked before the command was selected.
This sample shows how to set the angle constraint on the sketch tool. In a custom sketch tool the IApplication app is a field class and set using the hook parameter of the ICommand::OnCreate procedure.
private void SetAngleConstraint()
{
IEditor aEditor=app.FindExtensionByName("ESRI Object Editor") as IEditor;
double dPi=Math.PI;
IMxApplication mxApp=app as IMxApplication;
ISketchTool sketchTool=app.CurrentTool.Command as ISketchTool;
INumberDialog angleDialog=new NumberDialogClass();
if (angleDialog.DoModal("AngleConstraint", 0, 4, aEditor.Display.hWnd))
{
sketchTool.AngleConstraint=angleDialog.Value * dPi / 180;
sketchTool.Constraint=esriSketchConstraint.esriConstraintAngle;
}
}
IPoint Interface | IEditSketch Interface | IEditProperties Interface | IEditAttributeProperties Interface