Esri has a calculation attribute rule expression on GitHub called Set Ms to Index. The script loops through polyline vertices and updates the M-Values.
var current_line_geo = Geometry($feature);
var line_geo = Dictionary(Text(current_line_geo));
var paths = line_geo['paths'];
for (var path_idx in paths){
for (var vert_idx in paths[path_idx]){
That script works, but I'm having trouble understanding all the prep work that's involved -- for converting the feature's geometry into an array:
Feature —> Geometry —> Text —> Dictionary (type) —> Paths array (array is a key/value pair within dict)
That seems like a lot of overhead just to get at the vertices. Would someone be able to explain why all of those steps are needed — or if it can be simplified?
Thanks!