I'm trying to insert a bill of materials with View::InertBOMTable2, and it works when I use the parts only or indented style, but when I use the top level only style, SolidWorks crashes (from an addin - if I do it in a macro, SW doesn't crash but I get a nice error "The object invoked has disconnected from its clients" on that statement). I'm not specifying a configuration (as documented in the API docs), and even when I do it doesn't work. Here's what my call looks like:
(macro) Set MyBOM = MyView.InsertBomTable2(False, 0, 0, 1, 2, "", _ "C:\Program Files\SolidWorks\lang\english\bom-standard.sldbomtbt")
(C++) pView->InsertBomTable2(VARIANT_FALSE, 0, 0, swBOMConfigurationAnchor_BottomRight, swBomType_TopLevelOnly, CComBSTR(L""), CComBSTR(L"C:\\Program Files\\SolidWorks\\lang\\english\\bom-standard.sldbomtbt"), &pBomTA);
Anyone know what's up or how to work around it?
Thanks in advance, Jonathan Anderson