|
// TODO: add your code here
char *cue = "请选择插入体的点位置.";
double point[3] = {0.0, 0.0, 0.0}; /*获得点坐标*/
char promptString[133] = "选择即将导入的部件";
char titleString[133] = "选择即将导入的部件";
char filterString[133] = ".prt";/*输入文件类型*/
char defaultName[256+1] = "";/*输入and 输出 默认文件名*/
char filename[256+1] = "";/*输出完整的路径*/
int response = 0;
int err = UF_UI_create_filebox(promptString, titleString, filterString, defaultName, filename, &response);
if( (err==0) && (response==2) )
{
//uc1601(filename, 1);
UF_UI_POINT_base_method_t base_method;
base_method = UF_UI_POINT_INFERRED; /*默认选择-自动判断点*/
tag_t pt = NULL_TAG;
tag_t view_tag = NULL_TAG;
//int response = 0;
UF_UI_point_construct(cue, &base_method, &view_tag, point, &response);
if (response == 2)
{
/*导入prt 如导入图框(可以改变,导入点和比例)*/
UF_import_part_modes_t modes;
double dest_csys[6] = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0};
double scale = 1.0;
tag_t group=NULL_TAG;
modes.layer_mode = 0;
modes.group_mode = 1;
modes.view_mode = 0;
modes.cam_mode = FALSE;
UF_PART_import(filename, &modes, dest_csys, point, scale, &group);
uc1601("部件插成功", 1);
}
|
|