Bird
Raised Fist0
Solidworksbi_tool~10 mins

Bill of Materials (BOM) generation in Solidworks - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to insert a BOM table into the active drawing.

Solidworks
Dim swDraw As ModelDoc2
Dim swBOMTable As BomTableAnnotation
Set swDraw = swApp.ActiveDoc
Set swBOMTable = swDraw.InsertBomTable2([1], 0, 0, "", swBomTableAnchorType_e.swBomTableAnchorType_TopLeft, 0, 0, False, False)
Drag options to blanks, or click blank then click option'
AswBomType_e.swBomType_PartsOnly
BswBomType_e.swBomType_TopLevelOnly
CswBomType_e.swBomType_Indented
DswBomType_e.swBomType_IndentedTopLevel
Attempts:
3 left
💡 Hint
Common Mistakes
Using a BOM type that shows assemblies instead of parts.
2fill in blank
medium

Complete the code to set the BOM table to show quantities.

Solidworks
Dim swBOMTable As BomTableAnnotation
' Assume swBOMTable is already set
swBOMTable.ShowQuantity = [1]
Drag options to blanks, or click blank then click option'
ATrue
B0
CFalse
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using numeric values like 0 or 1 instead of Boolean.
3fill in blank
hard

Fix the error in the code to get the BOM table from the drawing sheet.

Solidworks
Dim swSheet As Sheet
Dim swBOMTable As BomTableAnnotation
Set swSheet = swDraw.GetCurrentSheet()
Set swBOMTable = swSheet.GetBomTable([1])
Drag options to blanks, or click blank then click option'
AswBomType_e.swBomType_PartsOnly
B1
C-1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 which causes an out-of-range error.
4fill in blank
hard

Fill both blanks to set the BOM table's configuration and update it.

Solidworks
swBOMTable.Configuration = [1]
swBOMTable.UpdateTable( [2] )
Drag options to blanks, or click blank then click option'
A"Default"
BTrue
CFalse
D"CustomConfig"
Attempts:
3 left
💡 Hint
Common Mistakes
Using a Boolean for configuration or a string for UpdateTable.
5fill in blank
hard

Fill all three blanks to create a BOM, set its type, and anchor it to the top-left.

Solidworks
Set swBOMTable = swDraw.InsertBomTable2([1], 0, 0, "", [2], 0, 0, [3], False)
Drag options to blanks, or click blank then click option'
AswBomType_e.swBomType_Indented
BswBomTableAnchorType_e.swBomTableAnchorType_TopLeft
CTrue
DswBomType_e.swBomType_PartsOnly
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up BOM types or anchor constants, or forgetting the Boolean.

Practice

(1/5)
1.

What is the primary purpose of a Bill of Materials (BOM) in SolidWorks?

easy
A. To list all parts and quantities needed for a product
B. To create 3D models of parts
C. To simulate product movement
D. To generate technical drawings automatically

Solution

  1. Step 1: Understand BOM definition

    A BOM is a list that details all parts and quantities required to build a product.
  2. Step 2: Compare options with BOM purpose

    Only To list all parts and quantities needed for a product correctly describes the BOM's role in listing parts and quantities.
  3. Final Answer:

    To list all parts and quantities needed for a product -> Option A
  4. Quick Check:

    BOM = List of parts and quantities [OK]
Hint: BOM always lists parts and quantities, not models or simulations [OK]
Common Mistakes:
  • Confusing BOM with 3D modeling or simulation
  • Thinking BOM creates drawings automatically
  • Assuming BOM is only for assembly instructions
2.

Which menu path in SolidWorks is used to insert a Bill of Materials table?

Choose the correct sequence.

easy
A. Tools > BOM > Insert Table
B. Insert > Tables > Bill of Materials
C. File > New > Bill of Materials
D. View > Tables > BOM

Solution

  1. Step 1: Recall SolidWorks menu for BOM

    The correct menu path to insert a BOM is under Insert > Tables > Bill of Materials.
  2. Step 2: Verify other options

    Options A, B, and D do not match the correct menu sequence for BOM insertion.
  3. Final Answer:

    Insert > Tables > Bill of Materials -> Option B
  4. Quick Check:

    Insert > Tables > BOM = Correct menu path [OK]
Hint: BOM is under Insert > Tables, not File or Tools [OK]
Common Mistakes:
  • Looking under File or Tools menus
  • Confusing BOM insertion with drawing creation
  • Selecting View menu instead of Insert
3.

Given an assembly with 3 parts: Part A (2 units), Part B (4 units), and Part C (1 unit), what will the quantity column show in the BOM?

Choose the correct quantities for each part.

medium
A. Part A: 2, Part B: 4, Part C: 1
B. Part A: 1, Part B: 1, Part C: 1
C. Part A: 3, Part B: 4, Part C: 2
D. Part A: 2, Part B: 2, Part C: 1

Solution

  1. Step 1: Identify quantities from assembly

    The assembly specifies Part A has 2 units, Part B has 4 units, and Part C has 1 unit.
  2. Step 2: Match quantities to BOM output

    The BOM quantity column reflects the exact counts of each part in the assembly.
  3. Final Answer:

    Part A: 2, Part B: 4, Part C: 1 -> Option A
  4. Quick Check:

    Quantities match assembly counts [OK]
Hint: BOM quantity matches assembly part counts exactly [OK]
Common Mistakes:
  • Assuming all quantities default to 1
  • Adding quantities incorrectly
  • Mixing up part counts
4.

When generating a BOM, a user notices the quantity column shows all 1s, even though some parts have multiple units. What is the most likely cause?

medium
A. The BOM is set to 'Parts Only' instead of 'Top-level only'
B. The assembly is missing part references
C. The BOM is set to 'Top-level only' instead of 'Parts Only'
D. The drawing sheet is not active

Solution

  1. Step 1: Understand BOM quantity settings

    'Top-level only' BOM counts each part once regardless of quantity, showing 1 for all.
  2. Step 2: Identify correct setting for quantities

    Setting BOM to 'Parts Only' aggregates quantities correctly, showing actual counts.
  3. Final Answer:

    The BOM is set to 'Top-level only' instead of 'Parts Only' -> Option C
  4. Quick Check:

    BOM setting affects quantity display [OK]
Hint: Use 'Parts Only' BOM to show correct quantities [OK]
Common Mistakes:
  • Confusing 'Top-level only' with 'Parts Only'
  • Assuming missing references cause quantity errors
  • Not checking BOM property settings
5.

You want to create a BOM that updates automatically when parts are added or removed from your assembly. Which approach should you take?

Choose the best practice for dynamic BOM updates.

hard
A. Manually create a BOM in Excel and update it after changes
B. Create BOM only after finalizing the assembly to avoid updates
C. Export BOM once and reuse the static file for all assemblies
D. Insert a linked BOM table in the assembly drawing that updates with changes

Solution

  1. Step 1: Understand dynamic BOM update methods

    Linked BOM tables in SolidWorks drawings update automatically when assembly changes.
  2. Step 2: Evaluate options for best practice

    Manual Excel or static exports do not update automatically; waiting until final assembly delays updates.
  3. Final Answer:

    Insert a linked BOM table in the assembly drawing that updates with changes -> Option D
  4. Quick Check:

    Linked BOM = automatic updates [OK]
Hint: Use linked BOM tables for automatic update in drawings [OK]
Common Mistakes:
  • Relying on manual Excel BOMs
  • Using static exports that don't update
  • Delaying BOM creation until assembly is final