Hide Table of Contents

Create Sheet Metal Gusset Example (VB.NET)

This example shows how to create a sheet metal gusset feature.

'----------------------------------------------------------------------------

' Preconditions:

' 1. Open public_documents\samples\tutorial\api\SMGussetAPI.sldprt.

' 2. Open an Immediate window.

'

' Postconditions:

' 1. Inserts Sheet Metal Gusset1.

' 2. Press F5 and observe the modified gusset.

' 3. Inspect the Immediate window for the flatten settings of the gusset.

' 4. Expand Flat-Pattern in the FeatureManager design tree, right-click

'    Flat-Pattern(1), and click Unsuppress.

' 5. Observe the center mark and profile of the gusset in its

'    flattened state.

'

' NOTE: Because the model is used elsewhere, do not save changes.

' ---------------------------------------------------------------------------

Imports SolidWorks.Interop.sldworks

Imports SolidWorks.Interop.swconst

Imports System.Runtime.InteropServices

Imports System

 

Partial Class SolidWorksMacro

    Public Sub main()

 

        Dim Part As ModelDoc2

        Dim myFeature As Feature

        Dim swFeat As Feature

        Dim swFeatData As SMGussetFeatureData

        Dim boolstatus As Boolean

        Part = swApp.ActiveDoc

 

        boolstatus = Part.Extension.SelectByID2("", "FACE", -0.0538403893476698, 0.0036701308754914, 0.05530817474488, False, 0, Nothing, 0)

        boolstatus = Part.Extension.SelectByID2("", "FACE", -0.0177780871801474, -0.0307393226379986, 0.0341128529187245, True, 0, Nothing, 0)

 

        swFeatData = Part.FeatureManager.CreateDefinition(swFeatureNameID_e.swFmSMGusset)

        swFeatData.UseOffset = True

        swFeatData.OffsetDistance = 0.05

        swFeatData.FlipOffset = False

        swFeatData.ProfileDimensionScheme = swSheetMetalGussetProfileDimType_e.swSheetMetalGussetProfileDimType_IndentDepth

        swFeatData.IndentDepth = 0.01

        swFeatData.ProfileLengthDim = 0#

        swFeatData.UseAngleDimForProfile = False

        swFeatData.ProfileHeightDim = 0#

        swFeatData.ProfileAngleDim = 0#

        swFeatData.FlipDimSides = False

        swFeatData.IndentWidth = 0.01

        swFeatData.GussetThickness = 0.003

        swFeatData.DraftAngle = 3 * 0.0175

        swFeatData.DraftSideFaces = True

        swFeatData.FilletInnerCorners = True

        swFeatData.InnerCornerFilletRadius = 0.002

        swFeatData.FilletOuterCorners = True

        swFeatData.OuterCornerFilletRadius = 0.001

        swFeatData.GussetType = swSheetMetalRibGussetType_e.swSheetMetalRibGussetType_Rounded

        swFeatData.FilletGussetEdges = False

        swFeatData.EdgeFilletRadius = 0#

        swFeatData.OverrideDocSettings = True

        swFeatData.ShowProfile = True

        swFeatData.ShowCenter = True

 

        myFeature = Part.FeatureManager.CreateFeature(swFeatData)

        Part.ClearSelection2(True)

 

        Stop

 

        'Modify type, draft, and outer corner fillet properties of the gusset

        boolstatus = Part.Extension.SelectByID2("Sheet Metal Gusset1", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0)

        swFeat = Part.SelectionManager.GetSelectedObject6(1, -1)

 

        swFeatData = swFeat.GetDefinition

        swFeatData.AccessSelections(Part, Nothing)

        swFeatData.GussetType = swSheetMetalRibGussetType_e.swSheetMetalRibGussetType_Flat

        swFeatData.DraftSideFaces = False

        swFeatData.FilletOuterCorners = False

        Debug.Print("Sheet Metal Gusset1 Flatten Settings")

        Debug.Print("  Override document flat pattern properties? " & swFeatData.OverrideDocSettings)

        Debug.Print("  Show center marks of the gusset in its flattened state? " & swFeatData.ShowCenter)

        Debug.Print("  Show profile of the gusset in its flattened state? " & swFeatData.ShowProfile)

 

        swFeat.ModifyDefinition(swFeatData, Part, Nothing)

        swFeatData.ReleaseSelectionAccess

 

    End Sub

    ''' <summary>

    ''' The SldWorks swApp variable is pre-assigned for you.

    ''' </summary>

    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

 
*Email:  
Subject:   Feedback on Help Topics
Page:   Create Sheet Metal Gusset Example (VB.NET)
*Comment:  
*   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:

x

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
x

Web Help Content Version: API Help (English only) 2021 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.