Hello everybody,
I'm trying to developp a macro with VB which sort the pins and the inserts of a CATProduct then hide them, I use the Search function.
Everything works fine but I need to run manually a search at the launch of CATIA V5. If I don't, the search function in the macro doesn't work. I'd like that my macro works without needing a first manually search.
I guess there is something that I need to activate but I don't know what.
My code:
Sub Search
Dim settingControllers1 As settingControllers
Set settingControllers1 = CATIA.settingControllers
Dim searchSettingAtt1 As searchSettingAtt
Set searchSettingAtt1 = settingControllers1.Item("CATCafSearchSettingCtrl" )
searchSettingAtt1.DeepSearchActivation = True
searchSettingAtt1.Commit
Dim productDocument1 As ProductDocument
Set productDocument1 = CATIA.ActiveDocument
CATIA.RefreshDisplay = False
Dim selection1 As Selection
Set selection1 = productDocument1.Selection
...
selection1.Search "...,all "
Dim selection2 As Selection
Set selection2 = productDocument1.Selection
Dim visPropertySet1 As VisPropertySet
Set visPropertySet1 = selection2.VisProperties
visPropertySet1.SetShow 1
selection2.Clear
End Sub
Would somebody know what is missing in my code ?
Thanks in advance.
Dina
I'm trying to developp a macro with VB which sort the pins and the inserts of a CATProduct then hide them, I use the Search function.
Everything works fine but I need to run manually a search at the launch of CATIA V5. If I don't, the search function in the macro doesn't work. I'd like that my macro works without needing a first manually search.
I guess there is something that I need to activate but I don't know what.
My code:
Sub Search
Dim settingControllers1 As settingControllers
Set settingControllers1 = CATIA.settingControllers
Dim searchSettingAtt1 As searchSettingAtt
Set searchSettingAtt1 = settingControllers1.Item("CATCafSearchSettingCtrl" )
searchSettingAtt1.DeepSearchActivation = True
searchSettingAtt1.Commit
Dim productDocument1 As ProductDocument
Set productDocument1 = CATIA.ActiveDocument
CATIA.RefreshDisplay = False
Dim selection1 As Selection
Set selection1 = productDocument1.Selection
...
selection1.Search "...,all "
Dim selection2 As Selection
Set selection2 = productDocument1.Selection
Dim visPropertySet1 As VisPropertySet
Set visPropertySet1 = selection2.VisProperties
visPropertySet1.SetShow 1
selection2.Clear
End Sub
Would somebody know what is missing in my code ?
Thanks in advance.
Dina