How to assign a value to a face

Hi everyone !
I’m just starting with ruby programmation and coding in general, so my question will may be easy but i’m totaly lost.
I would like ta assign a value to a face in communication with a repertory to translate this value into a defined colour. In the future this value could change by other parameters.
I try to find by myself a way to start via the SketchUp Ruby API Documentation but i don’t find what i need to search.
Any help would be greatful !

To assign a value to a face or any Sketchup Entity, use attributes. For example, face.set_attribute(“Faces”,“Colour”,face.material)

Thank’s for your answer
I will look for it in the API documentation though

There is a Ruby API specific sub-category.

The API documentation is a reference dictionary, not a learning text.

See this wiki-thread for help learning Ruby, and the SketchUp API:

1 Like

I recommend the first parameter in set_attribute to be a name related to your extension - in order to avoid clashing with other extensions. Treat it as you would do with a namespace - try to make it unique to your extension.

1 Like

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