查看单个帖子
旧 2007-06-23, 02:02 PM   #7
yogy
高级会员
 
注册日期: 06-11
帖子: 1527
精华: 15
现金: 6353 标准币
资产: 6353 标准币
yogy 向着好的方向发展
默认 回复: 【求助】SolidWorks2006 获得草图颜色

一、设置面的颜色
要考虑颜色获取的优先级
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的材质
yogy离线中   回复时引用此帖