Skip to content

self.getAllValues() and self.getValuesForGivenResultID() don't keep parameters in the same order

Another day, another CST weird behavior...

It looks like Parameter.getAllValues() and Parameters.getValuesForGivenResultID() don't return in the same order the simulation's parameters.

For instance, I tried with one of my projects:

3D:RunID:0: ['L', 'Px', 'Py', 'air_space', 'diode_len', 'diode_w', 'gap', 'ground_thickness', 'inside_radius', 'l1', 'l2', 'offset_left', 'offset_right', 'origin_x', 'origin_y', 'outside_radius', 'stub_thick', 'substract_thickness', 'x_offset', 'y_vias_offset']

3D:RunID:1: ['y_vias_offset', 'Px', 'Py', 'air_space', 'diode_len', 'diode_w', 'gap', 'ground_thickness', 'inside_radius', 'l1', 'l2', 'offset_left', 'offset_right', 'origin_x', 'origin_y', 'outside_radius', 'stub_thick', 'substract_thickness', 'x_offset', 'L']

This is problematic in the case where we use the last simulation run to fill a parameter list that is then used in combination with "getResultIDForParamCombination" for instance.

I'm not sure if it's a bug or a feature but I suggest that the API uses dict. In one hand, it prevents element order swap to break something and in an other hands, it gives more easy to work with data struct.

edit: I tried with another project, and this time the order isn't swapped, so my initial assumption was wrong.

Edited by NESPOULET Téo
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information