Starting the Sketch Tool

932
3
Jump to solution
06-12-2013 02:26 PM
AbdulrahmanAlqasim
New Contributor
hi everyone
simply, i want when the user clicks a button , the sketch tool starts and becomes ready to draw a shapefile .

this is part of i have tried :
editor.StartEditing(dataset.Workspace);  ISketchOperation2 sketchOperation = new SketchOperationClass();                       sketchOperation.Start(editor);


however this starts the editing session only but not the sketch tool
i appreciate your help
thank you
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
You can start the Edit Tool like this

public void CurrentTool(IApplication app) {     ICommandBars documentBars = app.Document.CommandBars;     UID cmdID = new UIDClass();     cmdID.Value = "{9EBF3A1E-D0C0-11D0-802D-0000F8037368}";     ICommandItem cmdItem = documentBars.Find(cmdID, false, false);     app.CurrentTool = cmdItem; }  

View solution in original post

0 Kudos
3 Replies
KenBuja
MVP Esteemed Contributor
You can start the Edit Tool like this

public void CurrentTool(IApplication app) {     ICommandBars documentBars = app.Document.CommandBars;     UID cmdID = new UIDClass();     cmdID.Value = "{9EBF3A1E-D0C0-11D0-802D-0000F8037368}";     ICommandItem cmdItem = documentBars.Find(cmdID, false, false);     app.CurrentTool = cmdItem; }  
0 Kudos
AbdulrahmanAlqasim
New Contributor
You can start the Edit Tool like this

public void CurrentTool(IApplication app)
{
    ICommandBars documentBars = app.Document.CommandBars;
    UID cmdID = new UIDClass();
    cmdID.Value = "{9EBF3A1E-D0C0-11D0-802D-0000F8037368}";
    ICommandItem cmdItem = documentBars.Find(cmdID, false, false);
    app.CurrentTool = cmdItem;
}





thank you a lot my friend
this value is for editing tool , the sketch tool has this value
cmdID.Value =  B479F48A-199D-11D1-9646-0000F8037368

i appreciate your help
0 Kudos
KenBuja
MVP Esteemed Contributor
Glad to help.

Please remember to click the check in the post to signify that your question has been answered.
0 Kudos