×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Insert BOM Table Example (VB)

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

RE: Insert BOM Table Example (VB)

I use this call in one of my routines to create a top-level BOM and it works fine.  I did include the BOM template in the call though, where you just send an empty string.  Try this:

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)

(OP)
Hi, Stoker:

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)

Yes, the statement I gave was pasted directly from my code and it works fine.  I notice that you are on 2005.  I am using 2006 SP1.  Maybe that is the difference?

RE: Insert BOM Table Example (VB)

(OP)
Hi, Stoker:

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources