First, correct me if I'm wrong, but it seems like you're asking how to expand the feature tree to show all components, as opposed to simply selecting all suppressed components. It appears you already know how do the latter. You might edit the post title and contents to reflect that better.
As for the issue itself, you can expand the entire feature tree using the asterisk on your Numpad. The problem is that VBA SendKeys does not normally work with the numpad I don't think there's an easy way to incorporate this into a macro. Nor does it appear that any command exists within ISldWorks::RunCommand to expand the feature tree.
Nevertheless, if you're really determined, you can use the information found here in conjunction with IAdvancedSelectionCriteria, which will let you select suppressed components with the API.
You can expand/collapse individual nodes using the TreeControlItem::Expanded. Take a look at this example: http://help.solidworks.com/2013/English/api/sldworksapi/expand_and_collapse_featuremanager_design_tree_nodes_vb.htm
Your macro needs to travesre a tree identify whether the component is suppressed and expand parent node.
Artem Taturevych, Application Engineer at Intercad (Australia)
translationXpert – add-in to translate SolidWorks models
myIntercad – an integrated tool for SolidWorks Professionals
Cool, Artem. I didn't know about ITreeControlItem::Expanded. Unfortunate that there's no member for accessing ITreeControlItem through IAssemblyDoc or IComponent2.
Derek, by the way, if you're only goal is to see the names of the components, you could display their names using a smart message (IModelDocExtension::ShowSmartMessage). You could use ISelectionMgr::GetSelectedObject6 to get all of the selected items, then use IComponent2::Name to get their names, then add to the smart message string.
Yes, it is only one way association. You can traverse the tree as the ITreeControlItem and do expand/collapse and get IFeature or IComponent2 from ITreeControlItem. But you cannot get the ITreeControlItem from IFeature or IComponent2.
Hi Keith and Artem,
Thanks a lot for your help. Learned a lot.
You understood my problem right mostly. It's about expand the tree. However, instead of expanding every single sub-assemblies it would helpful if I do advanced select on suppressed compnents only the sub-assemlies with the suppressed components in it will open up.
Maybe I ask too much, but I just think if the advanced selection highlights all the components why not just go one more step and show them.
I am not a experienced user (only two months with the tool) so I don't understand how to do macro at all. But good to know.