Select to view content in your preferred language

Enabling the default "Edit Tool" through a .net Add In button

760
2
Jump to solution
01-15-2013 04:45 AM
ScottStillwell
Deactivated User
I'm still coming up to speed on the Add-In .NET SDK for 10.x, and ArcObjects in general for that matter, so I'm sure the answer to this has been staring me right in the face.  I've been able to create new custom tools for editing and enable them via a button click on my add-in--the documentation is fairly clear on how to do this.  However, I've had the hardest time figuring out how to enable the standard "edit tool" (the one that looks like a small black arrow head on the editor toolbar) from a similar button click.  My goal is to have the user click a button on my add-in that will start an edit session and automatically enable the default edit tool with a specific target dataset.  Can this be accomplished using a feature template?  So far, those seem to only be used for adding new features, but I want the user to be able to click to select and then move features.

Any hints would be greatly appreciated.
0 Kudos
1 Solution

Accepted Solutions
ScottStillwell
Deactivated User
Figured it out for myself:

UID editorUID = new UIDClass(); editorUid.Value = "esriEditor.Editor"; IEditor3 Editor = ArcMap.Application.FindExtensionByCLSID(uid) as IEditor3;  Editor.StartEditing(versionedWorkspace as IWorkspace); UID pUID = new UIDClass(); ESRI.ArcGIS.Framework.ICommandItem pCommandItem; pUID.Value = "esriEditor.EditTool"; pCommandItem = ArcMap.Application.Document.CommandBars.Find(pUID, false, false);  ArcMap.Application.CurrentTool = pCommandItem;


The following link on the esri site is very helpful for finding UID values for existing ArcMap commands:
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000029s000000

View solution in original post

0 Kudos
2 Replies
ScottStillwell
Deactivated User
I can provide more detail if that would help.
0 Kudos
ScottStillwell
Deactivated User
Figured it out for myself:

UID editorUID = new UIDClass(); editorUid.Value = "esriEditor.Editor"; IEditor3 Editor = ArcMap.Application.FindExtensionByCLSID(uid) as IEditor3;  Editor.StartEditing(versionedWorkspace as IWorkspace); UID pUID = new UIDClass(); ESRI.ArcGIS.Framework.ICommandItem pCommandItem; pUID.Value = "esriEditor.EditTool"; pCommandItem = ArcMap.Application.Document.CommandBars.Find(pUID, false, false);  ArcMap.Application.CurrentTool = pCommandItem;


The following link on the esri site is very helpful for finding UID values for existing ArcMap commands:
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000029s000000
0 Kudos