thank you for the answer.
I tried to enter the codes but I want to insert a request if possible, for example:
the macro should be looking in a solid(PartBody) and not in Geometrical Set.
Thank you for your help.
Below an example:
Sub CATMain()
Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = partDocument1.Selection
selection1.Search "CATPrtSearch.Fillet,sel"
Set selection1 = CATIA.ActiveDocument.Selection
Set visPropertySet1 = selection1.VisProperties
visPropertySet1.SetRealColor 255, 255, 128, 1
There are multiple options, you have to think a little bit what you want.
For example, you can ask user to select first something (in your case the PartBody), or you can select first directly in the macro without asking user the PartBody and then, inside that selection, you can search whatever type of element you want.
It can be done also in different ways but you have also to specify what are you using: CATScript or catvba or something else (from how is looking your code I suppose you don't use catvbs).
Also, when you start to program in CATIA, take in consideration where that macro will be used (which OS, what CATIA version or release, is a CATIA network installation or not).