Rhino Layer Colour Assignment

I have a Rhinoscript code that takes a model built in a 3rd party application and converts it to a usable format for other personnel to use in Rhino.

My issues comes when I want to add a new layer, and assign a specific colour to that layer.

My code reads from a supporting excel spreadsheet that contains various RGB arrays corresponding to different layer items, etc.

When I come to create a new layer my code reads:

Rhino.AddLayer StructureDetailsArr(a, 5), StructureDetailsArr(a, 12), strParent

where structure details is the Array of information taken from Excel.

The part which is failing is StructureDetailsArr(a,12). for e.g. the output for the array is RGB(150,150,150).

This is failing and the new layer colour is being taken from the old objects colour which is not what I want. When I remove the array part of the code, and input RGB(150,150,150) it works and does what I want, but this is not practical when I need various new layers to have different colours.

I saw a thread which says you should convert the RGB colour to RGB int format using a formula, but when I do this, it doesnt give the colour I am looking for…

Any help would be appreciated.


Hi @user783,

The group will probably need to see some code, that they can run, in order to provide assistance.

– Dale