API: InsertBOMTable2 with top level only

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

Reply to
Jonathan Anderson
Loading thread data ...

Nice.. I was thinking along the same lines and decided it was too much work for something that wouldn't feel exact. So I just went on the assumption that it was going to be the same as the Custom Properties View. It is alot less work and will be accurate at least 98% of the time the way we do things here. I too am working with 2004. Let me know how it works out with the BOM from MRP system that might be a nice project for later. The only things I am worried about is the baloons, will they stay linked to the numbering system. We leave most fasteners, fluids and other BULK items off of the models for feasability but it might be beneficial to have them show up on the Drawing when updated with the MRP system.

Corey

Reply to
CS

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.