1

When I create new feature in editing session, I need to determine the new created feature is in which layer because after that have further more action on the layer. I wonder can this be done in vb.net arcobjects?

I am using vs2012 and arcmap 10.2.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Sep 5, 2014 at 4:45

1 Answer 1

4

Yes. You need to respond to the IEditEvents.OnCreateFeature which returns an object of type IFeature which has a property Class which will give you the feature class it belongs to.

After you have the feature class belonging to the new feature you can iterate through your editable layers (using IEditLayers.IsEdtiable) and see if the (ILayer as IFeatureLayer).FeatureClass matches - this will tell you what layer it is.

answered Sep 5, 2014 at 5:00
2
  • Thanks Michael, looks little complicated. Would trouble you if I still get problem in it. Commented Sep 5, 2014 at 5:57
  • It is (sort of) complicated, event programming is a little bit daunting at the start. You are using VB.net which is a little easier than C# when it comes to events. There's a little too much code to post in an answer - if you have a problem with one of the concepts you will get more detailed help with it like : How do I wire and respond to IEditEvents.OnCreateFeature in ArcGis? There are a few sample scripts around to show you how on the Esri help but they can be a little confusing. Commented Sep 7, 2014 at 21:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.