Allows access to a simple fillet feature.
'VBA
'Preconditions: Open Public_documents\SOLIDWORKS\SOLIDWORKS 2020\samples\tutorial\api\cube.sldprt.
'Postconditions:
'1. Creates an asymmetric face fillet between the selected faces.
'2. Inspect the graphics area.
'NOTE: Because the model is used elsewhere, do not save changes to it.
'===============================================================
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swModelDocExt As SldWorks.ModelDocExtension
Dim swFeatMgr As SldWorks.FeatureManager
Dim swFeat As SldWorks.Feature
Dim swFilletData As SldWorks.SimpleFilletFeatureData2
Dim swFeatDataObj As Object
Dim boolstatus As Boolean
Option Explicit
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swModelDocExt = swModel.Extension
Set swFeatMgr = swModel.FeatureManager
' Create the fillet feature data object
Set swFeatDataObj = swFeatMgr.CreateDefinition(swFmFillet)
Set swFilletData = swFeatDataObj
' Initialize the fillet feature data object with a simple fillet type
swFilletData.Initialize swFaceFillet
' Select adjacent faces using Marks 2 and 4
boolstatus = swModel.Extension.SelectByRay(-8.1276449166694E-03, 7.23380744250335E-02, 5.97881679346983E-02, -0.400036026779312, -0.515038074910024, -0.758094294050284, 2.27210389793168E-03, 2, False, 2, 0)
boolstatus = swModel.Extension.SelectByRay(5.01369231146214E-02, 6.23282644744449E-03, 5.13547742943388E-02, -0.400036026779312, -0.515038074910024, -0.758094294050284, 2.27210389793168E-03, 2, True, 4, 0)
swFilletData.AsymmetricFillet = True
swFilletData.DefaultRadius = 0.01
swFilletData.DefaultDistance = 0.02
' Narrow the fillet type by specifying the feature fillet profile type
swFilletData.ConicTypeForCrossSectionProfile = swFeatureFilletCircular
' Create the fillet feature
Set swFeat = swFeatMgr.CreateFeature(swFilletData)
End Sub