API - Determine if BOM table item is selected

Hi

I am developing a macro whereby users can select an item from a BOM table and the relevant component is opened so that some automation can occur on it. I have managed to link to the BOM table, and get the path names so that each component can be opened, I am having a mental block to get whether the item in the BOM table is selected or not. Does anyone know of a way to get whether the component is selected or not?

Many thanks

SolidworksApi macros