I know I am asking something stupid but just cant seem to get prebuilt materials to an object. I can get custom ones no problem. Here is my basic script (basic because I am a noob lol)
> # Default code, use or delete...
> ent = mod.entities # All entities in model
>
> # Lets load in some prebuilt materials we typically use
> win = Sketchup.platform == :platform_win
> mt_dir = Sketchup.find_support_file("Materials")
> prog_mt_dir = nil
> if win
> prog_mt_dir = mt_dir.gsub(
> ENV["APPDATA"].gsub(/\\\\|\\/,'/'),
> ENV["PROGRAMDATA"].gsub(/\\\\|\\/,'/')
> )
> else
> prog_mt_dir = mt_dir.dup
> end
> materials = Sketchup.active_model.materials
> @w_mat = materials.load(File.join(prog_mt_dir,
> "/Colors/Color M09.skm")),
> @w_mat = materials.load(File.join(prog_mt_dir,
> "/Glass and Mirrors/Translucent Glass Gray.skm"))
> @w_mat = materials.load(File.join(prog_mt_dir,
> "/Metal/Metal Corrugated Shiny.skm"))
>
> #Lets create some custom materials
> material = materials['Ceiling Tile'] || materials.add('Ceiling Tile')
> material.color = 'white'
> material = materials['Ceiling Grid'] || materials.add('Ceiling Grid')
> material.color = 'LightGrey'
> material = materials['Light Lens-1'] || materials.add('Light Lens-1')
> material.color = 'LightYellow'
> material = materials['Light Lens-2'] || materials.add('Light Lens-2')
> material.color = 'LightYellow'
> material = materials['0128_White'] || materials.add('0128_White')
> material.color = 'white'
>
> # Create the 1st box
> main_face = ent.add_face [0,0,0], [5,0,0], [5,5,0], [0,5,0]
> main_face.reverse!
> main_face.material = ('0128_White')
> main_face.pushpull 5, true
>
> # Create the 2nd box
> main_face = ent.add_face [10,0,0], [15,0,0], [15,5,0], [10,5,0]
> main_face.reverse!
> main_face.material = ('Translucent Glass Gray')
> main_face.pushpull 5, true