Randomize color with Dynamo

Hello to everybody. This is my first post in this forum. i need help to randomize panels of a curtain wall. i created e panel family in revit by model metric panel and then i did a script on dynamo to color in random way these. if i use this script in a new file (File-Project), it works without problem, but when i create the same script in my project file, it does not work. could anyone help me?