I have a macro that extracts the Mass Properties of every part/assembly in a master assemby if it is not suppressed or hidden. I do this by using "Application.SldWorks.ActiveDoc.GetComponents(False)" which gives me a full listing of the assembly tree. Using this list I first send it through IComponent2.GetSuppression and ICompenet2.IsHidden(False) to determine if it is a hidden or suppressed item. The issue is if a parent is hidden, the children are technically hidden as well in the assembly, but the API returns that is shown (even though the parent is hidden). For example given a sub-assembly P1 which is hidden and whose children are not isHidden(false) returns the following results:
Root/P1 --> True
Root/P1/C1 --> False
Root/P1/C2 --> False
Root/P1/C2/A1--> False
...
Etc
What is the best way to overcome this?
SolidworksApi macros