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 MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count Geometric Sets in Part Tree Root

Status
Not open for further replies.

CheeseMaker13

Aerospace
Joined
Sep 25, 2012
Messages
42
Location
GB
So the tree is:

Part
- xy plane
- yz plane
- zx plane
- Axis Systems
- PartBody
- Geo Set 1
- Geo Set 2
- Geo Set N

Basically, all I want is a count of how many geometrical sets there are (they are all named differently).

Tried to use code from here: but it didn't do what I wanted.

Thanks Again Guys!!
 
Language="VBSCRIPT"

Sub CATMain()

Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument

Dim selection1 As Selection
Set selection1 = partDocument1.Selection

selection1.Search "CATPrtSearch.OpenBodyFeature,all"

MsgBox "Number of geometrical sets in this active CATPart: " & selection1.Count

End Sub

Regards
Fernando

 
Hi,

Thanks Fernando. That works but also brings out geometrical sets inside the PartBody.

Perhaps I could do this search, then take away the Geometrical sets inside the PartBody?

Cheers
 
Whilst poking about with it running I found that the following brings out what I wanted:

oDocument.Part.HybridBodies.Count

Which is nice!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top