一、设置面的颜色
要考虑颜色获取的优先级
1)得到系统级别的颜色设置
//Use the integer user-preference enumerations to get and set system-level or document-level settings and options.
SldWorks::GetUserPreferenceIntegerValue and
SldWorks::SetUserPreferenceIntegerValue get and set system-level settings and options;
ModelDoc2::GetUserPreferenceIntegerValue and
ModelDoc2::SetUserPreferenceIntegerValue get and set document-level settings and options. ((from SW_API help doc))
// system option: get the default shading color for the body
defaultRGBColor = swModelDoc.GetUserPreferenceIntegerValue (185 /*swDocumentColorShading*/);
2)得到模型的材质
//This property gets or sets a material's properties in the active configuration. The material values include the color (R,G,B values), reflectivity (ambient, diffuse, specular, shininess), transparency and emission. (from SW_API help doc)
// // get the default display properties of the model If one exists, it's
// color overrides the default shading color
m_vParameters = swModelDoc.GetMaterialPropertyValues();
3)得到feature的材质
4)得到face的材质