×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

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

(OP)
Thank you Fernando, but I have read the page several times and I don't think there is the solution.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources