How do I programmatically get the current layer being edited from ArcMap 10?

1367
2
Jump to solution
02-13-2012 05:26 AM
by Anonymous User
Not applicable
Original User: Genaro Garcia

I need to programmatically get the current layer being edited in ArcMap 10.

Is there any sample code showing this?
Any ideas or advice?
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: sean_jones

If the user is creating features from a template then you can get the layer from the current template as shown in Using feature templates

IEditTemplate editTemplate = m_editor.CurrentTemplate; IFeatureLayer featLayer = editTemplate.Layer as IFeatureLayer;


If you're coming in from another path then you can get the current layer (editor target) from IEditLayers.CurrentLayer

View solution in original post

0 Kudos
2 Replies
by Anonymous User
Not applicable
Original User: sean_jones

If the user is creating features from a template then you can get the layer from the current template as shown in Using feature templates

IEditTemplate editTemplate = m_editor.CurrentTemplate; IFeatureLayer featLayer = editTemplate.Layer as IFeatureLayer;


If you're coming in from another path then you can get the current layer (editor target) from IEditLayers.CurrentLayer
0 Kudos
GenaroGarcia
New Contributor III
Sean,

I took the current layer (editor target) path.
I was missing a statement in my code.
Your advice resolved the issue.

A big THANKS....

Genaro L. Garcia, Jr.
IT/GIS �?? Programmer Analyst
100 N Walker Ave., 5th Floor
Oklahoma City, OK  73102
(405) 297-3172
0 Kudos