Hi,
Selections are major part of SOLIDWORKS API development and there are multiple techniques and aspects of selections API. I have written an article explaining the selection in depths, what is selection mark, selection data, different methods of selection (by id, in a batch, for API purpose only, etc.). Article and code examples can be found here: Selection
Thanks,
Artem
SolidworksApi macros