AnsweredAssumed Answered

ArcObjects OnCreateFeature not storing field values

Question asked by jalisdairi on Aug 3, 2014

In an edit session when a user draws a new line the code runs through OnCreateFeature and new the field values as specified in the code are populated correctly. However, if a user uses the planarize tool, despite the code running through the very same OnCreateFeature method and the correct values being applied with the set_Value line in the exact same way the resulting lines in the attribute table do not have the correct field values.


See the OnCreateFeature code here and the line which sets the values:

azgs-toolbar/ncgmpEditorExtension.cs at master · ncgmp09/azgs-toolbar · GitHub


I know from the ESRI docs that a planarize action would normally bypass the Create and Store mechanisms but code is in place to prevent this from happening and OnCreateFeature does run.


ESRI docs I've referenced:

IWorkspaceEditControl Interface

ArcObjects 10 .NET SDK Help


Line to force Store to run:

azgs-toolbar/ncgmpEditorExtension.cs at master · ncgmp09/azgs-toolbar · GitHub


As OnCreateFeature runs during a planarize it hits theRow.set_Value (in the first line referenced above) and as I step through the code I can see set_Value applying the desired field values. But when the OnCreateFeature code is finished for each new line created by the planarize the field attributes for the lines are not what was set in set_Value. They are just a duplication of the field values from the original lines.


Any ideas on how I can get the values I want to actually get stored in the attribute table when the planarize tool is run?


This issue is also documented in the code's GitHub repoistory:

Cannot apply values to selected features after planarizing lines · Issue #18 · ncgmp09/azgs-toolbar · GitHub.


Also, I don't know if it's related or not but the split policy for the database I'm using is set to duplicate. However, if I set it to default I get the same issue.


Any help would be much appreciated. Thanks!