Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a new assembly in SolidWorks.
Solidworks
AssemblyDoc = swApp.[1]("Assembly")
Attempts:
3 left
💡 Hint
Common Mistakes
Using OpenDocument instead of NewDocument
Trying to save before creating
✗ Incorrect
Use NewDocument to create a new assembly document in SolidWorks.
2fill in blank
mediumComplete the code to add a component to the assembly.
Solidworks
AssemblyDoc.[1]("C:\\Parts\\Part1.sldprt")
Attempts:
3 left
💡 Hint
Common Mistakes
Using InsertComponent which is not a valid method
Using ImportComponent which is for importing files
✗ Incorrect
The correct method to add a component is AddComponent.
3fill in blank
hardFix the error in the code to mate two components correctly.
Solidworks
AssemblyDoc.MateComponents(comp1, comp2, [1])Attempts:
3 left
💡 Hint
Common Mistakes
Using FIXED mate which locks position
Using SYMMETRIC which is for symmetrical alignment
✗ Incorrect
Use MateType.CONCENTRIC to mate cylindrical faces concentrically.
4fill in blank
hardFill both blanks to define a flexible subassembly and suppress a component.
Solidworks
AssemblyDoc.[1]("Subassembly1", True) AssemblyDoc.Components["Component1"].[2]()
Attempts:
3 left
💡 Hint
Common Mistakes
Using HideComponent instead of SuppressComponent
Using ActivateSubassembly instead of SetSubassemblyFlexibility
✗ Incorrect
Use SetSubassemblyFlexibility to make a subassembly flexible and SuppressComponent to suppress a component.
5fill in blank
hardFill all three blanks to update the assembly, rebuild, and save it.
Solidworks
AssemblyDoc.[1]() AssemblyDoc.[2]() AssemblyDoc.[3]("C:\\Assemblies\\Assembly1.sldasm")
Attempts:
3 left
💡 Hint
Common Mistakes
Using Close instead of SaveAs
Skipping Update before Rebuild
✗ Incorrect
First, Update the assembly, then Rebuild it, and finally SaveAs to save the file.
