You may want to look at this following Solidworks example, "Traversing Assembly at Component and Feature Levels".
I use traversing code at the place I work to detect features in a part and that is the code I used an example.
Hope it helps you out.
Call 2016 SOLIDWORKS API Help - GetBodies3 Method (IComponent2) . If this is null or empty - there is no geometry in there. Otherwise check the visibility for bodies to exclude the hidden ones: 2013 SOLIDWORKS API Help - Visible Property (IBody2)
Another way is to get the bounding box: 2013 SOLIDWORKS API Help - GetBox Method (IComponent2) and pass 'False' for both parameters to exclude sketches and ref planes. If the box is the point (diagonal length is 0) than there is no geometry in the component.
Thanks for the reply Ashok and Artem I will give you suggestions a shot here and hopefully they work. i have been really struggling with how to get the macro to differentiate if a component in an assembly has geometry in it.