selecting NodeToNodeAnchors in python script

Hi I am creating a model using a python script.

I have a number of NodeToNodeAnchors for anchors which are attached to embedded beam rows, and also some NodeToNodeAnchors for struts.

I make them in a specific order, so that i can select specific ones to activate during the phasing. But i have noticed that when Plaxis meshes them, it changes the order

Before meshing:

After meshing, in stage mode:

Thus when I select based on the original order, i get the wrong element.

How is this ordering calculated? How can i select the correct NodeToNodeAnchor?