Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pb: the automation of the Search function need a first manually search 1

Status
Not open for further replies.

Dina3419

New member
Aug 31, 2009
5
US
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
 
Replies continue below

Recommended for you

Thank you Fernando, but I have read the page several times and I don't think there is the solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top