OK there is a big bug in the IsHidden function.
Calling AssemblyDoc::GetComponents and looping through allcomponents of an assembly and calling IsHidden(true or false) oneach component returns invalid data.
Say you have an assembly with sub-assemblies within them and youhide a sub-assembly and all of its components, the IsHidden willreturn false (visible) for all components within that sub-assembly,and true (Hidden) for the sub-assembly itself.
If you take that one step further and have a sub-assembly inside asub-assembly and the top-level sub-assembly is hidden, only thatsub-assembly reports hidden, all over components including thesub-assembly within it report as visible!
Can anyone else check and confirm this behavious please.SolidworksApi macros
Calling AssemblyDoc::GetComponents and looping through allcomponents of an assembly and calling IsHidden(true or false) oneach component returns invalid data.
Say you have an assembly with sub-assemblies within them and youhide a sub-assembly and all of its components, the IsHidden willreturn false (visible) for all components within that sub-assembly,and true (Hidden) for the sub-assembly itself.
If you take that one step further and have a sub-assembly inside asub-assembly and the top-level sub-assembly is hidden, only thatsub-assembly reports hidden, all over components including thesub-assembly within it report as visible!
Can anyone else check and confirm this behavious please.SolidworksApi macros

A bit late to the game considering this was posted in 2008, but I can confirm this on Solidworks 2015. I'm running into the same issue.
Would anyone be able to advise a workaround outside of recursively going up the tree to the root to check if any parent, grandparent or ancestor is hidden or not? Would anyone be able to confirm that this has been fixed in later version of Solidworks?
I cant speak to work arounds or solutions but I think its reporting correctly. If you hide an assembly it only hides that assembly in that context, not any further or any sub assemblies or their parts. If you open a hidden sub assembly all of its parts will be shown. I wouldn't want to hide a sub assembly and then in turn all of its parts become hidden, sounds like a bad thing. Sometimes I hide part intentionally, if hiding and showing one step up un-hid those parts that would quickly become a bad thing.
Unless your intent is to traverse the sub assembly and hide all of its children?
Sorry I cant be of help, just wanted to chime in on the behavior of Hide/ Show.
Hi,
indeed this is wierd.
I've got the same behavior on 2019 SP05. The only workaround that I can think of is that, you call getcomponent on top level only, and if you find an assembly, you open it and parse it.
This should do the trick.
My end goal is to extract information about visible parts in an assembly. Parts only, not sub-assemblies. In my mind, if properties such as suppression and visibility are inherited by the parent in the context of an assembly, then the return for those properties in the API should also follow that inheritance scheme.
If it's not a bug, it doesn't make sense to me at a very fundamental level.
I ended up writing a quick recursive function that returns a bool depending on if any parents are hidden or visible. Works, but takes additional processing per each part which isn't ideal.
Thanks for confirming that it's the same in later versions of Solidworks! I ended up doing what you suggested as far as checking each parent component to the root on if it's visible or not. Cheers.