Hi, I am trying to recognize features automatically using the API. I wanted to know if there is something wrong with my code. If I replace fwOptions by fwExtrudeOption, then I get the extrude features only but for the rest nothing seems to work. Am I using the right constants ?
here is the code :
Private Const fwExtrudeOption As Long = 1 ' Extrudes
Private Const fwRevolveOption As Long = 2 ' Revolves
Private Const fwHoleOption As Long = 4 ' Holes
Private Const fwRibOption As Long = 64 ' Ribs
Private Const fwBaseFlangeOption As Long = 256 ' Base flange
Private Const fwSketchedBendOption As Long = 1024 ' Sketched bend
Private Const fwAllowFailFeatureCreation As Long = 1 ' Allow creation even with rebuild errors
' Build FeatureWorks recognition options
Dim fwOptions As Long
fwOptions = fwExtrudeOption + _
fwRevolveOption + _
fwHoleOption + _
fwRibOption + _
fwBaseFlangeOption + _
fwSketchedBendOption
' Run automatic recognition
Dim varOut As Variant
varOut = fwApp.RecognizeFeatureAutomatic(fwOptions)
' Create the recognized features
Dim created As Boolean
created = fwApp.CreateFeatures(fwAllowFailFeatureCreation)
If Not created Then
swApp.CloseDoc swPartModel.GetTitle()
RecognizeSheetMetal = "FeatureWorks CreateFeatures returned False."
Exit Function
End If
