Insert BOM Table Example (VB)
Insert BOM Table Example (VB)
(OP)
Hi, API experts:
I noticed that the following code from "Insert BOM Table and Get Data Example (VB), Welcome to SolidWorks and Add-Ins API Help"
'**********************************************************
Set swBomTable = swView.InsertBomTable2(False, vPickPt(0), vPickPt(1), swBOMConfigurationAnchor_TopLeft, swBomType_TopLevelOnly, "", "")
'**********************************************************
only works when BomType is set to 1 (swBomType_PartsOnly) or 3 (swBomType_Indented). It does not work when BomType is set to 2 (swBomType_TopLevelOnly).
I am wondering if you guys experienced the same problem? Do you know what is wrong?
Thanks,
Alex
SW2005 sp02
WinXP sp1.0
I noticed that the following code from "Insert BOM Table and Get Data Example (VB), Welcome to SolidWorks and Add-Ins API Help"
'**********************************************************
Set swBomTable = swView.InsertBomTable2(False, vPickPt(0), vPickPt(1), swBOMConfigurationAnchor_TopLeft, swBomType_TopLevelOnly, "", "")
'**********************************************************
only works when BomType is set to 1 (swBomType_PartsOnly) or 3 (swBomType_Indented). It does not work when BomType is set to 2 (swBomType_TopLevelOnly).
I am wondering if you guys experienced the same problem? Do you know what is wrong?
Thanks,
Alex
SW2005 sp02
WinXP sp1.0






RE: Insert BOM Table Example (VB)
Set swBomTable = swView.InsertBomTable2(False, vPickPt(0), vPickPt(1), swBOMConfigurationAnchor_TopLeft, swBomType_TopLevelOnly, "", "C:\Program Files\SolidWorks\lang\english\bom-standard.sldbomtbt")
RE: Insert BOM Table Example (VB)
Thanks for your reply! I intentionally omitted the BOM template in the call. When I tested the code, I did use my custom BOM plate.
But I got a bad new from SolidWorks API Support today. It says that this is an open issue. Here is a reply from SolidWorks API support today:
**********************************************************
"Unfortunately, this is an open issue. We have
SPR 278245 - View.InsertBomTable2 does not honor configuration passed in for top-level only type, creates empty table
"
(SolidWorks API Support)
**********************************************************
What is a disappointment! I almost got what I need to do (export BOM from SolidWorks drawing documents to my database automatically). But I think I can reconstruct "TopLevelOnly" BOM from "Indented" BOM.
Are you sure that you successfully used swView.InsertBomTable2 with swBomType_TopLevelOnly?
Thanks,
Alex
RE: Insert BOM Table Example (VB)
RE: Insert BOM Table Example (VB)
Thanks a lot!
I worked around this issue by reconstructing "TopLevelOnly" BOM from "Indented" BOM. For now, it works beautifully.
However, I am looking forward to using SW2006.
Alex
VB6.0
SW2005 sp02
WinXP sp1.0