Sorting Variable Name

When I created feature script that import data from CSV then add to Variable Table, the arrangement are random. How can make the arrangement the way I wanted?
Here's the script:

FeatureScript 1711;
import(path : "onshape/std/geometry.fs", version : "1711.0");


annotation { "Feature Type Name" : "CSV Configurator"}

export const importCSV = defineFeature(function(context is Context, id is Id, definition is map)
    precondition
    {
        annotation { "Name" : "Table" }
        definition.pointData is TableData;

    }
    {
        var importedData = definition.pointData.csvData;
        for (var i = 0; i < 11; i += 1)
        {
            setVariable(context, importedData[i][0], importedData[i][1]);
        }
    });
    

Answers

  • _anton
    _anton Member, Onshape Employees Posts: 555 image
    Indeed, this is a limitation that shows up when a feature writes multiple variables. Do feel free to submit an improvement request.
  • NeilCooke
    NeilCooke Moderator, Onshape Employees Posts: 6,126 image
    sort()
    Senior Director, Technical Services, EMEA