Unfortunately for some reason the opacity (alpha) of layers can not be set by Ruby.
At least I could not find a good method… neither a reason why this is not working?
@DanRathbun do you have some idea?
For example here the 4th parameter (11) should be the opacity value:
Sketchup.active_model.layers.color = [255, 255, 0, 11]
Theoretically this will set the color and the desired opacity of the layer, but somehow this is not applied to the model…
If I’m query it, looks applied
>> Color(255, 255, 0, 11)
But no, it is not “represented” on UI, so not really applied.
I know from API doc:
# You can then assign colors to the material of DrawingElements.
# Note that this creates a new Material object, and the alpha value
# of the color does NOT get applied to the new Material. You must
# manually set the alpha to get transparent materials.
I have been tried to manually set the alpha to get transparency for code above e.g.:
shade.alpha = 11
…but I didn’t really expect any results, since there is no face here… and a layer have NO material …
Unfortunately my knowledge is “stoping” here.