How to Unfold Sheet Metal in SolidWorks: Step-by-Step Guide
To unfold sheet metal in SolidWorks, use the
Flatten feature found in the Sheet Metal toolbar. First, create a sheet metal part with bends, then click Flatten to generate a flat pattern that shows the unfolded shape.Syntax
The main command to unfold sheet metal in SolidWorks is the Flatten feature. It is used after creating a sheet metal part with bends.
Flatten: Converts the bent sheet metal part into a flat pattern.Insert Bends: Defines bends in the sheet metal part.Edge Flange: Adds flanges to edges before flattening.
solidworks-macro
Flatten()
Example
This example shows how to unfold a simple sheet metal part with bends using the Flatten feature.
vba
Sub UnfoldSheetMetal()
Dim swApp As Object
Dim swModel As Object
Dim swFeat As Object
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
' Ensure the part is a sheet metal part
If swModel.GetType <> 1 Then
MsgBox "Open a part document first."
Exit Sub
End If
' Select the Flatten feature
Set swFeat = swModel.FeatureByName("Flatten")
If swFeat Is Nothing Then
' Insert Flatten feature if not present
swModel.InsertSheetMetalFlatten
Else
' Toggle Flatten
swFeat.Select2 False, -1
swModel.EditFeature
End If
swModel.ClearSelection2 True
End SubOutput
The sheet metal part is unfolded to show the flat pattern in the SolidWorks window.
Common Pitfalls
Common mistakes when unfolding sheet metal in SolidWorks include:
- Trying to flatten a part that is not defined as sheet metal.
- Not defining bends properly before flattening.
- Using complex features incompatible with sheet metal flattening.
- Forgetting to use the
Flattenfeature, which is required to see the unfolded shape.
Always start with a sheet metal template or convert your part to sheet metal before unfolding.
vba
'' Wrong: Trying to flatten a non-sheet metal part Sub WrongFlatten() Dim swModel As Object Set swModel = Application.SldWorks.ActiveDoc swModel.InsertSheetMetalFlatten ' This will fail if part is not sheet metal End Sub '' Right: Convert to sheet metal first Sub CorrectFlatten() Dim swModel As Object Set swModel = Application.SldWorks.ActiveDoc swModel.InsertSheetMetalFeature2 0, 0, 0, 0, 0 ' Converts to sheet metal swModel.InsertSheetMetalFlatten ' Then flatten End Sub
Quick Reference
| Feature | Purpose | Notes |
|---|---|---|
| Flatten | Unfolds the sheet metal part to flat pattern | Use after bends are defined |
| Insert Bends | Defines bend lines in the sheet metal | Required for accurate flattening |
| Edge Flange | Adds flanges to edges | Can be flattened with the part |
| Convert to Sheet Metal | Converts solid part to sheet metal | Must be done before flattening |
Key Takeaways
Use the Flatten feature to unfold sheet metal parts in SolidWorks.
Ensure your part is defined as sheet metal with proper bends before flattening.
Avoid flattening non-sheet metal parts to prevent errors.
Use Edge Flange and Insert Bends features to prepare your part for unfolding.
Check the flat pattern view to verify the unfolded shape.