Hi Sol,sorry for the delay. I called it a day last night, when this topic gave me a headache. Still working on it. The snippet you provided looks very promising, but I had no luck so far, getting this to work.Here is my current try:private void startEditingAndSelectEditLayer(ESRI.ArcGIS.Framework.IApplication ArcMap)
{
//derived from http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/2626201e-de60-4bab-bb1c-d16fcd4f8c4b.htm#NETFeature
ESRI.ArcGIS.Geodatabase.IFeatureClass m_featureClass;
ESRI.ArcGIS.Carto.IFeatureLayer m_featureLayer;
ESRI.ArcGIS.Editor.IEditor m_editor;
//get current document from ArcMap-Application
ESRI.ArcGIS.ArcMapUI.IMxDocument mxDocument = (ESRI.ArcGIS.ArcMapUI.IMxDocument)ArcMap.Document;
//get current contentsview
ESRI.ArcGIS.ArcMapUI.IContentsView curTOC = mxDocument.CurrentContentsView;
//get select featureLayer in contents view
//http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004900000016000000
m_featureLayer = ArcMapHelperFunctions.GetSelectedFeatureLayerInContentsView(mxDocument.CurrentContentsView);
//get featureClass of this layer
m_featureClass = m_featureLayer.FeatureClass;
//Once the feature class has been referenced, get the workspace to edit by creating an IFeatureWorkspace
//and setting an IWorkspace object to the feature workspace using a cast.
ESRI.ArcGIS.Geodatabase.IWorkspace editWorkspace = (m_featureClass as ESRI.ArcGIS.Geodatabase.IDataset).Workspace;
//Start an edit session on the workspace holding the feature class
ESRI.ArcGIS.esriSystem.UID editorUid = new ESRI.ArcGIS.esriSystem.UID();
editorUid.Value = "esriEditor.Editor";
m_editor = ArcMapHelperFunctions.app.FindExtensionByCLSID(editorUid) as ESRI.ArcGIS.Editor.IEditor3;
//define edit layer, to set the editor selecting a specific layer
//http://forums.arcgis.com/threads/110456-Is-it-possible-to-start-editing-of-a-specific-featureClass-programmatically
//http://forums.esri.com/Thread.asp?c=93&f=992&t=58618&mc=10#msgid147954
ESRI.ArcGIS.Editor.IEditLayers EditLayer;
EditLayer = (m_editor as ESRI.ArcGIS.Editor.IEditLayers);
MessageBox.Show(m_featureLayer.Name); //did I get the right layer?
MessageBox.Show(EditLayer.IsEditable(m_featureLayer).ToString()); //is it editable?
//EditLayer.SetCurrentLayer(m_featureLayer, 0); //set current layer before start editing -- no success
m_editor.StartEditing(editWorkspace);
m_editor.StartOperation();
EditLayer.SetCurrentLayer(m_featureLayer, 0); //set current layer after start editing -- no success
}
In the screenshot below you see Layer2 active in the TOC. This is correctly identified by m_featureLayer in the code above (cross-checked with the messagebox). But in the "create feature" dialog none of the layer becomes active. layer1 has a grey background but is not really activated, if you click on it, it gets a blue background and not till then you can start the sketch. And besides the 2nd layer should be the one activated.[ATTACH=CONFIG]33998[/ATTACH]Thanks for your help. Any hint is appreciated.RegardsFossi