马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
api如何求对象最大外形尺寸------我这代码 怎么测的很不准啊
char *message="请选择对象:";
char *title="请选择对象:";
int scope=UF_UI_SEL_SCOPE_NO_CHANGE;
int response;
tag_t object_tag;
double cursor[3];
tag_t view;
UF_UI_select_with_single_dialog(message,title,scope,NULL,NULL,&response,&object_tag,cursor,&view); //选择框】
UF_DISP_set_highlight(object_tag,0); //1高亮显示 0不高亮显示
//UF_OBJ_set_color(object_tag,20); //改颜色
double bounding_box[ 6 ];
UF_MODL_ask_bounding_box (object_tag, bounding_box ); //查询极点坐标 目前测试很不准 问题不断?
double point_coords_a1[3]={bounding_box[ 1 ],bounding_box[ 2 ],bounding_box[ 3 ]};//点坐标xyz
double point_coords_a2[3]={bounding_box[ 4 ],bounding_box[ 5 ],bounding_box[ 6 ]};
tag_t point_tag_a1,point_tag_a2;
UF_CURVE_create_point(point_coords_a1,&point_tag_a1); //调用API创建点
UF_CURVE_create_point(point_coords_a2,&point_tag_a2);
char box_x_x[22],box_x_y[22],box_x_z[22];
char box_d_x[22],box_d_y[22],box_d_z[22];
sprintf(box_x_x, "%d",bounding_box[ 1 ]); //数字转字符串
sprintf(box_x_y, "%d",bounding_box[ 2 ]);
sprintf(box_x_z, "%d",bounding_box[ 3 ]);
sprintf(box_d_x, "%d",bounding_box[ 4 ]);
sprintf(box_d_y, "%d",bounding_box[ 5 ]);
sprintf(box_d_z, "%d",bounding_box[ 6 ]);
UF_UI_open_listing_window(); //打开窗口
UF_UI_write_listing_window("最小坐标 "); //输入信息
UF_UI_write_listing_window(box_x_x);
UF_UI_write_listing_window(",");
UF_UI_write_listing_window(box_x_y);
UF_UI_write_listing_window(",");
UF_UI_write_listing_window(box_x_z);
UF_UI_write_listing_window("\n");
UF_UI_write_listing_window("最大坐标 ");
UF_UI_write_listing_window(box_d_x);
UF_UI_write_listing_window(",");
UF_UI_write_listing_window(box_d_y);
UF_UI_write_listing_window(",");
UF_UI_write_listing_window(box_d_z);
|