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!

Count Geometric Sets in Part Tree Root

Status
Not open for further replies.

CheeseMaker13

Aerospace
Sep 25, 2012
42
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!!
 
Replies continue below

Recommended for you

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