|
马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我编了一个程序,首先用UF_DRF_set_lettering_preferences设定字体参数,之后用uc5540()在图纸的某一位置写出一行文字。
写文字部分没有问题,但是设定字体参数部分有毛病,请高手指教。万分感谢!
UF_DRF_lettering_preferences_p_t lettering_preferences1;
UF_DRF_align_position_t align_position;
UF_DRF_text_just_t horiz_text_just;
double gdt_frame_height_factor;
double angle;
UF_DRF_lettering_t dimension_text1;
UF_DRF_lettering_t appended_text1;
UF_DRF_lettering_t tolerance_text1;
UF_DRF_lettering_t general_text1;
int lines_of_text;
char text_string[1][133];
double origin_3d[3];
int orientation;
tag_t text_tag;
//*******************************************************
//下面是用set_lettering_preferences设置字体参数
//*******************************************************
align_position=1;
horiz_text_just=1;
dimension_text1.size=3.5;
dimension_text1.character_space_factor=0.8;
dimension_text1.aspect_ratio=1.0;
dimension_text1.line_space_factor=1.0;
dimension_text1.cfw.color=3;
dimension_text1.cfw.font=3;
dimension_text1.cfw.width=3;
appended_text1.size=3.5;
appended_text1.character_space_factor=0.8;
appended_text1.aspect_ratio=1.0;
appended_text1.line_space_factor=1.0;
appended_text1.cfw.color=3;
appended_text1.cfw.font=3;
appended_text1.cfw.width=3;
tolerance_text1.size=3.5;
tolerance_text1.character_space_factor=0.8;
tolerance_text1.aspect_ratio=1.0;
dimension_text1.line_space_factor=1.0;
tolerance_text1.cfw.color=3;
tolerance_text1.cfw.font=3;
tolerance_text1.cfw.width=3;
general_text1.size=3.5;
general_text1.character_space_factor=0.8;
general_text1.aspect_ratio=1.0;
general_text1.line_space_factor=1.0;
general_text1.cfw.color=3;
general_text1.cfw.font=3;
general_text1.cfw.width=3;
//红字处估计有问题
lettering_preferences1->align_position=align_position;
lettering_preferences1->horiz_text_just=horiz_text_just;
lettering_preferences1->gdt_frame_height_factor=10.0;
lettering_preferences1->angle=1.0;
lettering_preferences1->dimension_text=dimension_text1;
lettering_preferences1->appended_text=appended_text1;
lettering_preferences1->tolerance_text=tolerance_text1;
lettering_preferences1->general_text=general_text1;
UF_DRF_set_lettering_preferences([$lettering_preferences1)]
/* 下面是写1行字 */
lines_of_text=1;
origin_3d[0]=100.0;
origin_3d[1]=115.0;
origin_3d[2]=0.0;
orientation=0;
strcpy(text_string[0], "<F15>这是一个标注This is a LABEL.<F>");
uc5540(lines_of_text,text_string,origin_3d,[$text_tag)] |
|