Hide Table of Contents

Create Thicken Feature Example (VBA)

This example shows how to create a thicken feature in a multibody part.



Dim FeatureBossArray(1) As Object


Part.SelectById2 "Extrude1", "SOLIDBODY", 0, 0, 0, swSelectOptionDefault

Part.AndSelectById "Extrude2", "SOLIDBODY", 0, 0, 0


Set FeatureBossArray(0) = SelMgr.GetSelectedObject5(1)

Set FeatureBossArray(1) = SelMgr.GetSelectedObject5(2)



Part.SelectByMark "Extrude2", "BODYFEATURE", 0, 0, 0, 0

Part.AndSelectByMark "Surface-Offset2", "SURFACEBODY", -0.02497777716906, -0.03617986965071, 0.1016290821131, 1

Part.AndSelectByMark "Extrude1", "SOLIDBODY", -0.02823155779504, -0.04351551915801, 0.007861557497051, 2

' Thicken the selected reference surface and then generate a boss

Set FeatureBoss = Part.FeatureManager.FeatureBossThicken(0.01, 0, -842150451, 0, 1, 1, 0)

' Set the property values for the selected feature

Part.SelectedFeatureProperties 0, 0, 0, 0, 0, 0, 0, 1, 0, "Thicken1"

Part.SelectById2 "Extrude2", "SOLIDBODY", 0, 0, 0, swSelectOptionDefault

Part.SelectById2 "Thicken1", "SOLIDBODY", 0, 0, 0, swSelectOptionDefault


' Get the thicken feature definition object

Set FeatureBoss_DEF = FeatureBoss.GetDefinition

FeatureBoss_DEF.AccessSelections Part, Nothing

' Set the solid bodies that the thicken feature affects in the multibody part

FeatureBoss_DEF.FeatureScopeBodies = FeatureBossArray

' Update the definition of the thicken feature

FeatureBoss.ModifyDefinition FeatureBoss_DEF, Part, Nothing

' Display the number solid bodies affected by the thicken feature

Debug.Print FeatureBoss_DEF.GetFeatureScopeBodiesCount

' Display whether the results of this thicken feature are merged

partDebug.Print FeatureBoss_DEF.Merge

' Display whether all or only specific bodies were automatically selected for the thicken feature

Debug.Print FeatureBoss_DEF.AutoSelect


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:   Create Thicken Feature Example (VBA)
*   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) 2015 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.