this can be done using a series of attributes, I place a ready-made set in a scaler / swatch which I usually hide, then refence that, saves having to rebuild the code again
There is an example here
How to create a trapezoidal dynamic furniture - SketchUp / Dynamic Components - SketchUp Community