I am making a very simple script that creates layers in Rhino. The idea is to use this instead of a standard Rhino template file, I would like to be able to just click a button in Grasshopper and the layers are created, colors, materials, lineweights, etc. are applied.
The problem is that I can’t find a way to automatically import the Rhino materials from files. I would like it to automatically import everything from a specified folder. I have looked around but I can’t seem to find anything that does exactly this.
This is how far I have gotten with the material import part:
Instead of accesing the command line, you could access the material by layer using rhinoscriptsyntax: rs.AddMaterialToLayer(layer)
Here is an example add_material_layer.gh (5.3 KB) It works the same with textures and bumps.
It’s not exactly what I’m looking for though, since I would like to use already existing materials from .rmtl files. So I don’t want to define the properties inside Grasshopper, just to import them and apply them to the layers I’m creating in another part of the script. I realize this might not be possible and then your solution is probably the right way to go.