public void ExportToDump(ref string asciitext)
{
ModelDoc2 swModel;
ConfigurationManager swConfMgr;
Configuration swConf;
Component2 swRootComp;
swModel = (ModelDoc2)this.mSWApplication.ActiveDoc;
swConfMgr = (ConfigurationManager)swModel.ConfigurationManager;
swConf = (Configuration)swConfMgr.ActiveConfiguration;
swRootComp = (Component2)swConf.GetRootComponent3(true);
asciitext = "# Dump hierarchy from SolidWorks \n" +
"# Assembly: " + swModel.GetPathName() + "\n\n\n";
// The root component (root assembly) cannot work in DumpTraverseComponent()
// cause SW api limit, so call feature traversal using this custom step:
Feature swFeat = (Feature)swModel.FirstFeature();
DumpTraverseFeatures(swFeat, 1, ref asciitext);
// Traverse all sub components
if (swModel.GetType() == (int)swDocumentTypes_e.swDocASSEMBLY)
{
DumpTraverseComponent(swRootComp, 1, ref asciitext);
}
}