×
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

How to check whether a given body is hidden or not in CATIA V5 VBA Macro

How to check whether a given body is hidden or not in CATIA V5 VBA Macro

How to check whether a given body is hidden or not in CATIA V5 VBA Macro

(OP)
Hello,

In my vba macro, I need to take screen shot of the geometry of all bodies present inside a CATPart and show it an excel sheet.
But my search results shows all bodies, even if they are hidden.
Input to my method is the "Body"

MySelection.Search "(((((((((((CATStFreeStyleSearch.OpenBodyFeature + CATPrtSearch.OpenBodyFeature) + CATGmoSearch.OpenBodyFeature) + CATSpdSearch.OpenBodyFeature) + CATStFreeStyleSearch.Plane) + CATPrtSearch.Plane) + CATGmoSearch.Plane) + CATSpdSearch.Plane) + CATStFreeStyleSearch.AxisSystem) + CATPrtSearch.AxisSystem) + CATGmoSearch.AxisSystem) + CATSpdSearch.AxisSystem),all"
visPropertySet2.SetShow 1


So either I need to change my search or from the search result filter out those bodies which are hidden.
I don't want to take screen shot of the bodies which are hidden.

Can anyone please tell me the code for the same, to identify whether the given body is hidden or not OR to search only bodies which are visible?

Thanks,
Ajay

RE: How to check whether a given body is hidden or not in CATIA V5 VBA Macro

Hi,

Your search criteria should be an advanced one and look like bellow, including attribute:

'Part Design'.Body.Visibility=Visible - you said bodies, not GeometricalSets, meaning OpenBody.

Now, depending on how you want to get the pictures (I suppose you want to take screenshots), you have to loop between bodies or get them all.

Regards
Fernando

https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...

RE: How to check whether a given body is hidden or not in CATIA V5 VBA Macro

(OP)
I got the solution smile


MySelection.Search "(CATPrtSearch.BodyFeature.Visibility=Visible),all"

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