Macro SW Feature manager Filter

Hello,
I’m trying to make a filter in vba (code below), but the compression is different from the manual input method.

Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swModelDocExt As SldWorks.ModelDocExtension
Dim value As String
Dim value2 As String

Sub main()
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Set swModelDocExt = swModel.Extension


    value = "Rondelle"

    'add value to Filter
    swModelDocExt.FeatureManagerFilterString = value
    'Get value of filter
    value2 = swModelDocExt.FeatureManagerFilterString
    Debug.Print value2

    'To delete filter (Very long-> Another method?)
    swModelDocExt.FeatureManagerFilterString = ""
    'swModel.ClearSelection2 True
End Sub

With the Vba method, the 3D graphics part is filtered, but not the FeatureManagerTree part and no value in the filter is displayed.

With the manual method, the 3D part and the FeatureManagerTree are well filtered.:

2 problems :
differents between the manual method and the Vba method. (Bug?)
Slowness in clearing the filter.

Wish:
Quick filter on a property of an assembly and its sub-assemblies.
And display visual or other feedback if this value is found.

Did you tried to find out the specific command of the text input field? Maybe there is a difference to the FeatureManagerFilterString… but to be honest - I guess it’s a bug

2 Likes

I also guess, it’s a bug
Thanks @Marcel, I’ve tried the 2 methods (Macro and Spy++), they work for other commands but not for this filter unfortunately.
Les 2 solutions proposés par code stack semble échouer pour ce filtre.
Unless I’m doing it wrong, perhaps, but no capture is made when an entry is made in this filter.