I'm working on a C++ Application that will pull a complete BOM from a solidworks assembly document using the Document Manager API.
I'm not sure there is any correlation here, but on smaller assemblies my code seems to work and I am able to obtain a list of Components, but on large top level assemblies I am unable to get a list of components.
Here is my pseudo code. (I'm using the variable types to show which methods I'm calling)
ISwDMDocument15Ptr = ISwDMApplication3Ptr->GetDocument();
ISwDMConfigurationMgrPtr = ISwDMDocument15Ptr->ConfigurationManager;
names = ISwDMConfigurationMgrPtr->GetConfigurationNames();
ISwDMConfiguration13Ptr = ISwDMConfigurationMgrPtr->GetConfigurationByName(names[0]);
ISwDMConfiguration13Ptr->GetComponents();
This code works for some .sldasm files but not others.
PS: I do not normally work with SolidWorks so maybe my terminology is off. Should Get Components return sub assemblies as well as just parts?
SolidworksApi macros