|
|
发表于 2014-4-23 20:24:44
|
显示全部楼层
|
static void do_api() { tag_t object,view; char cue[] = "select object to get the dimensions"; int scope = UF_UI_SEL_SCOPE_WORK_PART; double x,y,z; int response; double boundingbox[6]; double cursor[3]; UF_UI_select_with_single_dialog(cue,"select the object",scope, UF_UI_sel_init, NULL, &response, &object, cursor, &view ); if (response == UF_UI_OBJECT_SELECTED || response == UF_UI_OBJECT_SELECTED_BY_NAME) { UF_DISP_set_highlight(object,0); UF_MODL_ask_bounding_box(object,boundingbox); x = boundingbox[3]-boundingbox[0]; y = boundingbox[4]-boundingbox[1]; z = boundingbox[5]-boundingbox[2]; char message[256]; sprintf(message," X dimension = %.3f\n Y dimension = %.3f\n Z dimension = %.3f\n",x,y,z); uc1601(message,1); } else uc1601("No object selected",1); } } |
|