Bird
Raised Fist0
Solidworksbi_tool~10 mins

Sub-assembly creation 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 create a new sub-assembly in SolidWorks.

Solidworks
SubAssembly = swApp.[1]("Assembly")
Drag options to blanks, or click blank then click option'
ACloseDocument
BOpenDocument
CSaveDocument
DNewDocument
Attempts:
3 left
💡 Hint
Common Mistakes
Using OpenDocument instead of NewDocument
Trying to save before creating the assembly
2fill in blank
medium

Complete the code to add a component to the sub-assembly.

Solidworks
component = SubAssembly.[1]("C:\\Parts\\Part1.sldprt")
Drag options to blanks, or click blank then click option'
AOpenComponent
BAddComponent5
CInsertComponent
DAddComponent
Attempts:
3 left
💡 Hint
Common Mistakes
Using AddComponent which does not exist
Using OpenComponent which opens a file but does not add it
3fill in blank
hard

Fix the error in the code to properly save the sub-assembly.

Solidworks
SubAssembly.[1]("C:\\Assemblies\\SubAssembly1.sldasm")
Drag options to blanks, or click blank then click option'
ASave
BExport
CSaveAs
DSaveDocument
Attempts:
3 left
💡 Hint
Common Mistakes
Using Save which does not take a filename parameter
Using Export which is for different file formats
4fill in blank
hard

Fill both blanks to properly open and activate a sub-assembly document.

Solidworks
doc = swApp.[1]("C:\\Assemblies\\SubAssembly1.sldasm")
doc.[2]()
Drag options to blanks, or click blank then click option'
AOpenDoc6
BActivate
COpenDocument
DRebuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using OpenDocument which is not the correct API method
Forgetting to activate the document after opening
5fill in blank
hard

Fill all three blanks to create a sub-assembly, add a component, and save it.

Solidworks
subAsm = swApp.[1]("Assembly")
subAsm.[2]("C:\\Parts\\Part2.sldprt")
subAsm.[3]()
Drag options to blanks, or click blank then click option'
ANewDocument
BAddComponent5
CSave
DOpenDocument
Attempts:
3 left
💡 Hint
Common Mistakes
Using OpenDocument instead of NewDocument
Using AddComponent instead of AddComponent5
Forgetting to save the assembly

Practice

(1/5)
1.

What is the main purpose of creating a sub-assembly in SolidWorks?

easy
A. To group related parts for easier management
B. To create a new part from scratch
C. To export the assembly as a 2D drawing
D. To change the color of parts automatically

Solution

  1. Step 1: Understand sub-assembly concept

    Sub-assemblies group related parts to manage them easily within a larger assembly.
  2. Step 2: Compare options

    Options A, B, and D describe unrelated tasks, not the main purpose of sub-assemblies.
  3. Final Answer:

    To group related parts for easier management -> Option A
  4. Quick Check:

    Sub-assembly = Group parts [OK]
Hint: Remember: sub-assemblies simplify complex assemblies [OK]
Common Mistakes:
  • Confusing sub-assembly with part creation
  • Thinking sub-assembly changes part colors
  • Assuming sub-assembly exports drawings
2.

Which of the following is the correct way to create a sub-assembly in SolidWorks?

1. Insert parts into a new assembly document
2. Save the assembly with a clear name
3. Use the sub-assembly inside a larger assembly
easy
A. Create a new part, then save as sub-assembly
B. Export parts as separate files and link them
C. Open a drawing and add parts as sub-assembly
D. Insert parts into a new assembly, save it, then use it inside a larger assembly

Solution

  1. Step 1: Identify correct sub-assembly creation steps

    Insert parts into a new assembly document, save it clearly, then use it inside a bigger assembly.
  2. Step 2: Eliminate incorrect options

    Create a new part, then save as sub-assembly creates a part, not a sub-assembly. Open a drawing and add parts as sub-assembly uses drawings incorrectly. Export parts as separate files and link them exports parts separately, not sub-assembly.
  3. Final Answer:

    Insert parts into a new assembly, save it, then use it inside a larger assembly -> Option D
  4. Quick Check:

    Sub-assembly steps = Insert + Save + Use [OK]
Hint: Think: assemble parts first, then save as sub-assembly [OK]
Common Mistakes:
  • Saving a part as sub-assembly
  • Trying to create sub-assembly inside a drawing
  • Not saving the assembly before using it
3.

Given a main assembly with two sub-assemblies, each containing 3 parts, how many total parts will the main assembly show?

medium
A. 2
B. 3
C. 6
D. 9

Solution

  1. Step 1: Calculate parts in each sub-assembly

    Each sub-assembly has 3 parts, so 2 sub-assemblies have 3 x 2 = 6 parts.
  2. Step 2: Add parts from sub-assemblies to main assembly

    Main assembly includes all parts from sub-assemblies, so total parts = 6.
  3. Step 3: Check if main assembly has extra parts

    Since main assembly contains 2 sub-assemblies only, total parts = 6 parts inside sub-assemblies plus 0 extra parts = 6.
  4. Final Answer:

    6 -> Option C
  5. Quick Check:

    2 sub-assemblies x 3 parts = 6 parts [OK]
Hint: Multiply sub-assemblies by parts inside each [OK]
Common Mistakes:
  • Counting sub-assemblies as parts
  • Adding sub-assemblies and parts incorrectly
  • Ignoring parts inside sub-assemblies
4.

What is wrong with this sub-assembly creation process?

1. Insert parts into assembly
2. Save assembly as a part file (.sldprt)
3. Use it inside main assembly
medium
A. Inserting parts before saving is wrong
B. Saving assembly as a part file is incorrect
C. Using sub-assembly inside main assembly is not allowed
D. Parts should be inserted after saving

Solution

  1. Step 1: Identify file type error

    Assemblies must be saved as assembly files (.sldasm), not part files (.sldprt).
  2. Step 2: Confirm correct workflow

    Insert parts, save as assembly file, then use inside main assembly.
  3. Final Answer:

    Saving assembly as a part file is incorrect -> Option B
  4. Quick Check:

    Assembly file extension = .sldasm [OK]
Hint: Save assemblies as .sldasm, not .sldprt [OK]
Common Mistakes:
  • Saving assemblies as part files
  • Confusing file extensions
  • Thinking parts insert order matters
5.

You have a complex assembly with 50 parts. To improve performance, you want to create sub-assemblies. Which approach is best?

hard
A. Group related parts into sub-assemblies and save them separately
B. Keep all parts in one assembly without sub-assemblies
C. Create sub-assemblies but do not save them separately
D. Convert all parts into drawings before assembly

Solution

  1. Step 1: Understand performance benefits

    Grouping related parts into sub-assemblies reduces complexity and improves performance.
  2. Step 2: Importance of saving sub-assemblies

    Saving sub-assemblies separately allows reuse and better management.
  3. Step 3: Evaluate other options

    Keeping all parts together slows performance; not saving sub-assemblies loses benefits; converting parts to drawings is unrelated.
  4. Final Answer:

    Group related parts into sub-assemblies and save them separately -> Option A
  5. Quick Check:

    Sub-assemblies + save separately = better performance [OK]
Hint: Save sub-assemblies separately to improve performance [OK]
Common Mistakes:
  • Not saving sub-assemblies separately
  • Keeping all parts in one big assembly
  • Confusing drawings with assemblies