Dynamic component generated from within Ruby: how to update options

we have generated a lot of dynamic models from within Ruby, so we don’t have to draw them every time (see https://3dwarehouse.sketchup.com/by/MayGmbH ).

However updating the options is a major pain.
We have not managed to swap e.g. the choice of colours by Ruby.

Does anybody know how to do that?

Any help or even a hint whom to contact would be appreciated!
Kind regards

There are several similar threads…
See DanR’s simple ‘redraw’ code in the second post…

1 Like

So if you use ruby to make the components, you would only have to change the order of the materials in the script once, and then run the script, not?
Btw, nice looking models out there!
ps. when a (potential) customer is given that much options, aren’t they a little overwhelmed?
Is it not consumer friendly to let them pick a color with the native color sampler from the Color-swatch? Or check the sedan from the components sampler…

1 Like

Hi Mike,
thanks for nicely illustrated help! However - sorry! - I did not ask clearly:
we have generated the models by Ruby, but we added the options (e.g. each color) “by hand”.
So either a) I need to learn how to add the options by Ruby (any tipps on this?) OR
b) I need to learn how to insert a new option (colour) into to existing list of colours at a certain place in the existing list.

We don’t want to pick “just” colours, as there’s only a certain range of textile
colours/textures (>50) which we can manufacture. The range of colours changes
from time to time, so we have to update the list.
Yes, the huge load of Information may be overwhelming, but that’s our business model: we supply extremely customized, high quality parasols.

Best regards

Go to the SketchUp Extension Warehouse, and get a SketchUp attribute editor plugin, such as:

THEN (after installing the plugin,) you can use the editor to insert the option text directly into the option field, where you want it to appear.

The options need to be separated with a & and the display label and value separated with a = char.
BUT, … special characters (like "|",) and whitespace needs to use numeric character references using Percent-Encoding.



Hello Dan,
thanks, that’s a very useful tipp!
That’ll do the job for now (copy&past, modify the options and past it back).
Thanks a lot!

Another question, related to it: the person who generated all our models is running out of time.
Do you know a proficient ruby programmer, who I could ask to program me some task,
like “open each of my models, change to color 1, save it, change to color 2, save it, …”
(we want to render all possible variantions, approx. 7500 in Cinema4D; so need to have them ready for import first)?

Best regards

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.