Hide Table of Contents

Convert Extrusion to Sheet Metal Example (VB.NET)

This example shows how to convert a solid body to sheet metal.

' Preconditions:
' 1. Open <SolidWorks_install_dir>\samples\tutorial\api\sweepcutextrude.sldprt.
' 2. Open an Immediate Window.
' Postconditions:
' 1. Boss-Extrude1 is converted to sheet metal containing two rip edges.
' 2. The FeatureManager design tree now contains:
'        * Sheet-Metal1
'        * Convert-Solid1
'        * Flat-Pattern1

' NOTE: Because the part is used in SolidWorks tutorials,

' do not save any changes to it.
Imports SolidWorks.Interop.sldworks
Imports SolidWorks.Interop.swconst
Imports System

Partial Class SolidWorksMacro

Sub main()

Dim swDoc As ModelDoc2 = Nothing
        Dim boolstatus As Boolean = False
        swDoc =
CType(swApp.ActiveDoc, ModelDoc2)
        boolstatus = swDoc.Extension.SelectByID2(
"", "FACE", -0.008205131831119, 0.02357994168915, 0.03366815886659, True, 0, Nothing, 0)
        boolstatus = swDoc.Extension.SelectByID2(
"", "EDGE", -0.004077318654993, 0.02376323764372, 0.04987547143355, True, 1, Nothing, 0)
        boolstatus = swDoc.Extension.SelectByID2(
"", "EDGE", 0.02890215593544, 0.02392631827274, 0.03020230805026, True, 1, Nothing, 0)
        boolstatus = swDoc.Extension.SelectByID2(
"", "EDGE", -0.007010951021414, 0.02376186282277, -0.0001235945334201, True, 1, Nothing, 0)

' Convert extrusion to sheet metal of thickness=13mm, bend radius=0.5mm,

'rip gap=2mm, relief type = rectangular, relief ratio = 0.5,

'rip edge overlap type = open butt, and rip edge overlap ratio = 0.5,

'do not keep bodies
        boolstatus = swDoc.FeatureManager.InsertConvertToSheetMetal2(0.013, False, False, 0.0005, 0.002, 0, 0.5, 1, 0.5, false)

End Sub

    Public swApp As SldWorks

End Class

Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

Subject:   Feedback on Help Topics
Page:   Convert Extrusion to Sheet Metal Example (VB.NET)
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:


We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again

Web Help Content Version: API Help (English only) 2014 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.