Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

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

Status
Not open for further replies.

ajayjain831

Computer
Joined
Aug 6, 2014
Messages
2
Location
GB
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
 
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

 
I got the solution :-)


MySelection.Search "(CATPrtSearch.BodyFeature.Visibility=Visible),all"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top