com.esri.arcgis.editor
Interface ISketchTool

All Superinterfaces:
Serializable
All Known Implementing Classes:
ISketchToolProxy

public interface ISketchTool
extends Serializable

Provides access to members that control the main sketch tool.

Remarks

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.

When To Use

Use ISketchTool when you want to set and get specific information about the sketch tool.

Product Availability

Available with ArcGIS Desktop.

See Also:
IPoint, IEditProperties, IEditAttributeProperties, IEditSketch

Method Summary
 void addPoint(IPoint point, boolean esri_clone, boolean allowUndo)
          Adds a point to the sketch.
 IPoint getAnchor()
          The anchor of the sketch.
 double getAngleConstraint()
          The sketch's angular constraint.
 int getConstraint()
          The sketch constraint.
 double getDistanceConstraint()
          The sketch's distance constraint.
 IPoint getLocation()
          The current location of the mouse.
 boolean isStreaming()
          Indicates whether stream mode digitizing is enabled.
 void setAngleConstraint(double val)
          The sketch's angular constraint.
 void setConstraint(int constraint)
          The sketch constraint.
 void setDistanceConstraint(double val)
          The sketch's distance constraint.
 void setIsStreaming(boolean isStreaming)
          Indicates whether stream mode digitizing is enabled.
 

Method Detail

getAnchor

IPoint getAnchor()
                 throws IOException,
                        AutomationException
The anchor of the sketch.

Description

Read-only property. Returns the point location for the sketch anchor .

Remarks

The anchor point is the pivot point for the rubberband feedback used in sketching polylines and polygons. It is also the last point added to the edit sketch.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
A reference to a com.esri.arcgis.geometry.IPoint
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLocation

IPoint getLocation()
                   throws IOException,
                          AutomationException
The current location of the mouse.

Description

Read-only property. Returns the point location of the mouse.

Remarks

The Location Property can be used to determine whether the current location of the mouse is suitable for adding a point to the edit sketch.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
A reference to a com.esri.arcgis.geometry.IPoint
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getConstraint

int getConstraint()
                  throws IOException,
                         AutomationException
The sketch constraint.

Description

Gets/sets the esriSketchConstraint type applied to the sketch tool.

Remarks

The Constraint property gets/sets the current sketch constraint type applied to the sketch tool. The default constraint is esriConstraintNone.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
A com.esri.arcgis.editor.esriSketchConstraint constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setConstraint

void setConstraint(int constraint)
                   throws IOException,
                          AutomationException
The sketch constraint.

Description

Gets/sets the esriSketchConstraint type applied to the sketch tool.

Remarks

The Constraint property gets/sets the current sketch constraint type applied to the sketch tool. The default constraint is esriConstraintNone.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
constraint - A com.esri.arcgis.editor.esriSketchConstraint constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAngleConstraint

double getAngleConstraint()
                          throws IOException,
                                 AutomationException
The sketch's angular constraint.

Description

Gets/Sets angular constraints applied to the sketch tool.

Remarks

The AngleConstraint property can be used to retrieve angular constraints applied to the sketch tool using the 'Angle' sketch tool context menu choices or can be used to set angular constraints to the sketch directly. This property sets/gets angle values measured in radians. To convert radians to degrees use the following formula: degrees = radians * (pi/180)

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The val
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAngleConstraint

void setAngleConstraint(double val)
                        throws IOException,
                               AutomationException
The sketch's angular constraint.

Description

Gets/Sets angular constraints applied to the sketch tool.

Remarks

The AngleConstraint property can be used to retrieve angular constraints applied to the sketch tool using the 'Angle' sketch tool context menu choices or can be used to set angular constraints to the sketch directly. This property sets/gets angle values measured in radians. To convert radians to degrees use the following formula: degrees = radians * (pi/180)

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
val - The val (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDistanceConstraint

double getDistanceConstraint()
                             throws IOException,
                                    AutomationException
The sketch's distance constraint.

Description

Gets/sets length constraints applied to the sketch tool.

Remarks

This returns the current distance constraint that may have been established, for example, through the Sketch Tool context menu item 'Length'. This property can also be set, and in order to activate the distance constraint the Constraint property must be set to esriConstraintDistance. (see example code, where esriConstraintAngle is used )

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The val
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDistanceConstraint

void setDistanceConstraint(double val)
                           throws IOException,
                                  AutomationException
The sketch's distance constraint.

Description

Gets/sets length constraints applied to the sketch tool.

Remarks

The DistanceConstraint property can be used to retreieve length constraints applied to the sketch tool using the 'Length' sketch tool context menu choice or can be used to set distance constraints directly.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
val - The val (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isStreaming

boolean isStreaming()
                    throws IOException,
                           AutomationException
Indicates whether stream mode digitizing is enabled.

Remarks

Use IsStreaming to start and stop stream mode digitizing when using the Sketch Tool.

If you set the value of IsStreaming equal to TRUE, the Sketch Tool will add points to the sketch as you move the mouse around the map. You can get/set the StreamTolerance value using the IEditProperties interface.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The isStreaming
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setIsStreaming

void setIsStreaming(boolean isStreaming)
                    throws IOException,
                           AutomationException
Indicates whether stream mode digitizing is enabled.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
isStreaming - The isStreaming (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addPoint

void addPoint(IPoint point,
              boolean esri_clone,
              boolean allowUndo)
              throws IOException,
                     AutomationException
Adds a point to the sketch.

Description

Adds a new point to the edit sketch.

Remarks

Same as calling IEditSketch::AddPoint, this method adds a new point to the sketch geometry. The optional clone argument will create a copy of the point object before adding it to the sketch.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
point - A reference to a com.esri.arcgis.geometry.IPoint (in)
esri_clone - The esri_clone (in)
allowUndo - The allowUndo (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.