How to get and set information about style in model

for example how to set color of edges to “By material”?

Have you looked at Class: Sketchup::RenderingOptions — SketchUp Ruby API Documentation?

Sketchup.active_model.rendering_options["EdgeColorMode"]

gives access to the settings for the edge colour mode. Experimentally, the corresponding values seem to be as follows:

All same” - 1
By material” - 0
By axis” - 2

So calling:

Sketchup.active_model.rendering_options["EdgeColorMode"] = 0

will set the edge colour mode to “By material

I would have expected there to be a constant defined in the API for each of these values, but if there is, it does not seem to be mentioned in the documentation.

Even if there isn’t, you can define custom ones for yourself in your code.

Thank you, Archidave.