Change Custlistitems name

Hello,

I’m trying to create a macro to traverse the feature manager and rename the cutlistitems.

The name should be changed accordingly to:

The name of the parent of the custlist                                 (in the example, “N1”)

The name of the first child (substring before the “_” character)   (in the example, “A” or “B”)

And a counter

Like this:

N1

|____   CutList

                |____   N1A1

                |                |____A_1

                |____   N1A2

                |                |___  A_2

                |                |____A_3

                |____   N1B3

                |                |____B_1

                |____   N1B4    

                                  |____B_2

Does anyone know how to do this?

Thanks,

Joana

SolidworksApi macros