Incremental PartFamily Naming

Hello

Is it possible to name PartFamilyName in an incremental way. For example, I want to do something similar to what I have shown below:

feature

User.Objects.GetElementsInCell Bentley.GC.Features.Solid

{

Cell = aCell;

PartFamilyName = 'Pier' + Series(0,20,1);

PartName = 'Foundations';

}

The above does not work. I have also tried to write a script, and while it does seem to work for some things it does not always work. I have pasted in the script below.

    feature User.Objects.FoundationDrop Bentley.GC.Features.Solid
    {
        Function                  = function (Cell[] cll)
                                    {
                                    ClearConsole();
                                    
                                        for (int i = 0; i < cll.Count; ++i)
                                        {
                                        
                                                Solid fndDrop = new Solid(this);
                                                fndDrop.FromElementsInCell(cll[i]);
                                                
                                                
                                                fndDrop.PartFamilyName = 'Pier' + i;
                                                fndDrop.PartName = 'Foundations';
                                    
                                                
                                                Print(fndDrop.PartFamilyName);
                                                Print(fndDrop.PartName);
                                                
                                    
                                        }
                                        
                                    };
        FunctionArguments         = {Flatten({Reverse(FoundationCell2),FoundationCell,Reverse(FoundationCell4), FoundationCell3})};
    }
}
The above works sometimes, but in the above example it does not work. The PartFamilyName does not get added to the element. Anyone can see what I am doing wrong?