Count number of solid elements in the tree
Count number of solid elements in the tree
(OP)
Hi guys,
i'm trying to develop a simple code to count the number of solid elements in the my main body.
The problem is, it only returns the number 1.
If any of you can help me. Thx a lot
Sub CATMain()
Dim MyPart As Part
Dim MyBodies As Bodies
Set MyPart = CATIA.ActiveDocument.Part
Set MyBodies = MyPart.Bodies
MsgBox (MyBodies.Count)
End Sub
i'm trying to develop a simple code to count the number of solid elements in the my main body.
The problem is, it only returns the number 1.
If any of you can help me. Thx a lot
Sub CATMain()
Dim MyPart As Part
Dim MyBodies As Bodies
Set MyPart = CATIA.ActiveDocument.Part
Set MyBodies = MyPart.Bodies
MsgBox (MyBodies.Count)
End Sub





RE: Count number of solid elements in the tree
You mean mechanical features? If yes, check macro bellow (it will count in all bodies, not only in main body, you need to modify macro if you want only in main body).
CODE --> CATScript
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Count number of solid elements in the tree
Try ctrl + F and specify the elements to search and click search and select. It displays the no of elements selected.
Hope it helps. All the best.