fannonj

Maintaining ID history on split using class extension

Discussion created by fannonj on Mar 3, 2011
Hi

I'm writing a class extension that does a whole bunch of custom stuff in the OnCreate and OnChange events. However, I need to implement the following logic when a feature is split:

1) Populate new IDs (not object ids) for the resulting features
2) Store the old IDs (not object ids) from the original feature in a new field

Eg.

Original Feature: CUSTOMID 123, HISTORICID = NULL
Split Feature 1: CUSTOMID = 456, HISTORICID = 123
Split Feature 2: CUSTOMID = 457, HISTORICID = 123

After some brief testing what I get after a split operation is one OnCreate and one OnChange event. I.e. one new feature created and one whose geometry is modified. For the OnChange I can obviously capture the old ID from IRowChanges, but I'm guessing IRowChanges isn't useful in the OnCreate?

Another thing that would be useful it to be able to capture that these changes resulted from a split operation, but I'm guessing there's no easy way to do that either.

I'm sure somebody must have implemented something similar before. The logic isn't complex but the implementation looks like it might be. Any assistance/advice would be very much appreciated.

I'm using 9.3.1 and c# if that's useful.

John

Outcomes