Hello . I want to make a macro for automatic feature recognition of an imported model and create the features under the tree . I have tried the below codes . It's running but didn't get any feature .

Sub main()

Dim swApp As Object

Dim sample As Object

Dim Part As Object

Dim boolstatus As Boolean

Dim inp As Boolean

Set swApp = CreateObject("SldWorks.Application")

Set sample = swApp.GetAddInObject("FeatureWorks.FeatureWorksApp")

Dim varOut As Variant

Dim var1 As Boolean

Dim unused As Integer

Dim options As Long

Set Part = swApp.ActiveDoc

options = fwChamfils + fwExtrudeOption  ' For two feature only

varOut = sample.RecognizeFeatureAutomatic(options )

createOption = fwAllowFailFeatureCreation

var1 = sample.CreateFeatures(createOption)

End Sub

SolidworksApi/macros