Select to view content in your preferred language

Stumped on ediOnChangeFeature Event - different results with different edit tasks...

613
1
05-03-2010 02:09 PM
SimonWillis
Emerging Contributor
I'm working in 92 and I am stumped again on

private void m_editEvents_OnChangeFeature(IObject obj)...

Issue 1:
Let me explain. I have a geometric network containing fire hydrants, laterals, etc. The fire hydrants have feature linked anno. I created a DLL containing an editevents_onChangeFeature and onCreateFeature event.
During debug mode, when a FH is moved my code stops at a break point where I can see the object fed into the change event is the FH. So all is good here and I know my event_change feature works. During this change event I autopopulate some fields, and then it iterates through change event again.
question1: Why does my code iterate through change event again? And why does it do that more than once for no apparant reason? I thought it was refiring the change event because the object or feature kept changing (first spatially then attributes). Does it keep reiterating through the change event until no changes are detected? For some fire hydrants I tested, I am debugging my code 4 times for one and the same FH I only moved once...
Anyway, after that it does laterals which makes sense because they are connected to the fire hydrants but sometimes too it refires 4 times but I don't change any fields in the lateral layer. Once makes sense to me because the geometry changed.

Issue 2:
When the active edit task is 'create new feature' and I move a FH with the edit tool, this FH is processed >1 by the change event, so is the lateral, and then it stops. It never processes the feature linked anno.
When the active edit task is 'modify feature' and I move a FH, first the lateral is processed n times, then the FH n times, and anno1 FC, anno2 FC, anno3 FC, and anno 4 FC are all processed n times. So then it works great, except n times seems a bit much.

Why are the anno FC processed during a modify feature task and not when the feature task is set to create new feature? Could dirty data play a role?
Thx!
0 Kudos
1 Reply
KirkKuykendall
Deactivated User
Where/when are you wiring the OnChangeFeature event?

It sounds to me like you may be wiring it multiple times, which would cause your handler to get called multiple times.
0 Kudos