Creating new face style objects

Hi all,

 

Im trying to write a macro which can change the color of the selected parts in a assembly. Therefore i want to define a new color (face style) by RGB code.

But i was not able to create a new face style object where i can define the RGB code.

 

Would be nice if somebody could post some helpful c# code...

 

Thanks!

 

 occurrence = assembly.Occurrences.Item(1);
                
                farben = assembly.FaceStyles;
                farbe = farben.Item(20); // need to replace this with code that creates a net face style
                //farben.Add("test","which parent? syntax?");
                              
                farbe.StyleName = "test color";
                
                farbe.SetAmbient(1f, 0f, 0f);
                farbe.SetSpecular(1f, 0f, 0f);
                farbe.SetDiffuse(1f, 0f, 0f);
                farbe.Shininess = 1;              
occurrence.FaceStyle = farbe;

 

Posted by: Christoph
Post date: 2/13/2012 1:25:10 PM