AnsweredAssumed Answered

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 .

Question asked by Md Rakibul Islam on Jan 22, 2019
Latest reply on May 20, 2019 by Md Rakibul Islam

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

Outcomes