How do I add the "Metal" material to an object with python?

I would like to be able to add the “Metal” material to an object and then change some of the metal material properties (like “Polish”).

To accomplish this in the Rhino UI:

  1. Select the Materials panel
  2. Click on the “+” button and select “Metal”
  3. Drag the slider for “Polish” to the desired value
  4. Drag material icon onto object in the scene

How would I accomplish the above using python?

On a broader note, is there any documents I could read to explain the Rhino materials/rendering setup? I am a little confused with how I should be thinking about materials in the rhino world.

I’ll do a more elaborate answer tomorrow, but you could start by checking