Create Full-Round Fillet Example (VBA)
This example shows how to create a full-round fillet.
'-------------------------------------------
'
' Preconditions: Part document is open that contains
' a
part with three adjacent face sets.
'
' Postconditions: The selected faces are a full
' round
fillet.
'
'------------------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swModelDocExt As SldWorks.ModelDocExtension
Dim swFeatMgr As SldWorks.FeatureManager
Dim boolstatus As Boolean
Dim FilletOptions As Long
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swModelDocExt = swModel.Extension
Set swFeatMgr = swModel.FeatureManager
swModel.ClearSelection2 True
'Select the faces to convert to full round fillet
'* 2 = Side Face Set 1
'* 512 = Center Face Set
'* 4 = Side Face Set 2
boolstatus = swModelDocExt.SelectByID2("",
"FACE", 0.003517242530847, -0.05909435470718, 0.05488982615105,
False, 2, Nothing, 0)
boolstatus = swModelDocExt.SelectByID2("",
"FACE", 0.0682416381139, -0.04272255565681, 0.04828090491452,
True, 512, Nothing, 0)
boolstatus = swModelDocExt.SelectByID2("",
"FACE", 0.02668003833887, 0.06228864415081, 0.04989937598589,
True, 4, Nothing, 0)
'Fillet options
FilletOptions = swFeatureFilletPropagate + swFeatureFilletUniformRadius
+ swFeatureFilletAttachEdges + swFeatureFilletKeepFeatures
'Create the full round fillet
swFeatMgr.FeatureFillet
FilletOptions, 0.01, swFeatureFilletType_FullRound, swFilletOverFlowType_Default,
0, 0, 0
End Sub