Hi,
Sorry for so long since I started this post. I have had a lot of difficulties with other parts of my code, but I did find a fix for this - not glamorous but it works perfectly well.
I have nodes, elements, loads, restrictions and fixings in my model that I want to be able to select. if I want to select a node then the nearest node to the cursor is what I want. For loads etc. it has to be the nearest load that is selected but loads can only exist at nodes and there may be 100 nodes and only 2 or 3 loads anywhere in the model.
Considering selection of nodes, currently when the node positions are plotted the node number is plotted next to it. The routine to write the node number is beyond my total understanding but it places it based on the actual viewport location based on the top
left of the form (opengl object in the form actually). So every time a node number is plotted, I store that X,Y pair in an array. When I want to select a node, on MouseDown the screen position X,Y is compared to the stored X,Y's from placement of the node numbers and works out which is closest. Works perfectly. For loads etc. the X,Y is stored where the load number would be in a separate array and that is used when I want to select only loads. And so on for other features like restraints.
I know it is not very clever but it does work very well and it has allowed me to progress with other aspects of the program.
Thanks for the support.