自定义函数printf_line
//输出line_coords的坐标信息void printf_line(UF_CURVE_line_t line_coords){ UF_UI_open_listing_window(); char str[128]="start_point\t"; UF_UI_write_listing_window(str); for (int i=0;i<=2;i++) { char str[128]=""; sprintf(str,"%lf\t",line_coords.start_point[i]); UF_UI_write_listing_window(str); } sprintf(str,"\n"); UF_UI_write_listing_window(str); sprintf(str,"end_point\t"); UF_UI_write_listing_window(str); for (int i=0;i<=2;i++) { char str[128]=""; sprintf(str,"%lf\t",line_coords.end_point[i]); UF_UI_write_listing_window(str); }}
函数入口:
/* TODO: Add your application code here */ double start[3]={ 0.0,0.0,0.0}; double end[3]={ 100.0,100.0,100.0}; tag_t line_tag=NULL_TAG; UF_CURVE_line_t line_coords; create_line_twopiont(start,end,&line_tag); tag_t curve_id=NULL_TAG; curve_id=line_tag; UF_CURVE_ask_line_data(curve_id,&line_coords);//查询结构体line_coords起点、终点函数 printf_line(line_coords); /* Terminate the API environment */
运行结果: