×
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

Count Geometric Sets in Part Tree Root

Count Geometric Sets in Part Tree Root

Count Geometric Sets in Part Tree Root

(OP)
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: http://www.coe.org/p/fo/et/thread=26239, but it didn't do what I wanted.

Thanks Again Guys!!

RE: Count Geometric Sets in Part Tree Root

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

https://picasaweb.google.com/102257836106335725208

RE: Count Geometric Sets in Part Tree Root

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

RE: Count Geometric Sets in Part Tree Root

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

oDocument.Part.HybridBodies.Count

Which is nice!

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