Visibility of component

Hi,

I select the root component and hide all components using the context menu on right click.

Using the API, when i check the visibility property of a component in a child assembly, it is still true.

How do I get the correct state of a component using the API?

SolidworksApi/macros