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!!
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
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
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
oDocument.Part.HybridBodies.Count
Which is nice!
RE: Count Geometric Sets in Part Tree Root
'Part Design'.'Geometrical Set'.Visibility=Shown
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
RE: Count Geometric Sets in Part Tree Root
Regards
Fernando
https://picasaweb.google.com/102257836106335725208