I´ve edited the CutTool-example from GitHub to also modify the created/changed features.
his is my modified code:
<SPAN class="keyword token">var</SPAN> rowCursor <SPAN class="operator token">=</SPAN> layer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Search</SPAN><SPAN class="punctuation token">(</SPAN>myGeometry<SPAN class="punctuation token">,</SPAN> SpatialRelationship<SPAN class="punctuation token">.</SPAN>Crosses<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> fc <SPAN class="operator token">=</SPAN> layer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetFeatureClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> fkzFieldIndex <SPAN class="operator token">=</SPAN> fc<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetDefinition</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FindField</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"FSK"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>fkzFieldIndex <SPAN class="operator token">==</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">return</SPAN> Task<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FromResult</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">false</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">int</SPAN> index <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// add the feature IDs into our prepared list</SPAN>
<SPAN class="keyword token">while</SPAN> <SPAN class="punctuation token">(</SPAN>rowCursor<SPAN class="punctuation token">.</SPAN><SPAN class="token function">MoveNext</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> feature <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>Feature<SPAN class="punctuation token">)</SPAN> rowCursor<SPAN class="punctuation token">.</SPAN>Current<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> geomTest <SPAN class="operator token">=</SPAN> feature<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetShape</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>geomTest <SPAN class="operator token">!=</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">// make sure we have the same projection for geomProjected and geomTest</SPAN>
<SPAN class="keyword token">var</SPAN> geomProjected <SPAN class="operator token">=</SPAN> GeometryEngine<SPAN class="punctuation token">.</SPAN>Instance<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Project</SPAN><SPAN class="punctuation token">(</SPAN>geometry<SPAN class="punctuation token">,</SPAN> geomTest<SPAN class="punctuation token">.</SPAN>SpatialReference<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// we are looking for polygons are completely intersected by the cut line</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>GeometryEngine<SPAN class="punctuation token">.</SPAN>Instance<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Relate</SPAN><SPAN class="punctuation token">(</SPAN>geomProjected<SPAN class="punctuation token">,</SPAN> geomTest<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"TT*F*****"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">// add the current feature to the overall list of features to cut</SPAN>
oids<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN>rowCursor<SPAN class="punctuation token">.</SPAN>Current<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetObjectID</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
cutOperation<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Modify</SPAN><SPAN class="punctuation token">(</SPAN>rowCursor<SPAN class="punctuation token">.</SPAN>Current<SPAN class="punctuation token">,</SPAN> fkzFieldIndex<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"MyNewFKZ"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">// add the elements to cut into the edit operation</SPAN>
cutOperation<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Split</SPAN><SPAN class="punctuation token">(</SPAN>layer<SPAN class="punctuation token">,</SPAN> oids<SPAN class="punctuation token">,</SPAN> geometry<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//execute the operation</SPAN>
<SPAN class="keyword token">var</SPAN> operationResult <SPAN class="operator token">=</SPAN> cutOperation<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Execute</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">return</SPAN> Task<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FromResult</SPAN><SPAN class="punctuation token">(</SPAN>operationResult<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>So I have a list of oids of features that I want to assign new attributes and that I want to split afterwards. My feature is split, but it does not get the value "MyNewFKZ" assigned to the FKZ-field. Did I miss anything here? I can´t see how may code differs from the example.
Just an asside: I also subscribed to the RowCreatedEvent in order to set the FKZ for the newly created feature as well. The handler is appropriately called and the new feature gets the FKZ-field assigned. Uncommenting that handler however has no effect on the modified feature.