Forum

RhinoScript – Applying Weight, Color info to object

if you still need help on this one:
You can attach string data to any object . have a look at GetUserText and SetUserText. This works as a key/value pair, so you can set and read any number of strings.

Any help would be much appreciated. I'm struggling writing some of my first rhinoscripts.

I'm trying to make a script (or two scripts in sequence) that would apply CUSTOM info to an object (weight per unit, color) and then have a script that could calculate the object's weight.

Basically I see scripts that calculate weight, but they ASK the user to input the weight density. Is there a way to let it know that "Thix box is steel, which has a weight of 90 Lbs/Foot, calculate the area". Click on another box and it knows "This box is wood, which has a weight of 12 lbs/foot, calculate the area". So you just click on the box and it calculates the area because it already knows that the box is steel, rather than specifying the density each time.