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.ClearSelection
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
FeatureBoss_DEF.ReleaseSelectionAccess