|
最近在琢磨隐藏模型项的问题,编了如下一个小程序:
int fun_button5()
{
ProError status;
ProModelitem myMdlitem;
ProSelection *p_sel;
int n_sel = 0;
ProSelect((char *)"csys", 1, NULL, NULL, NULL, NULL, &p_sel, &n_sel);
ProSelectionModelitemGet(p_sel[0], &myMdlitem);
status = ProModelitemHide(&myMdlitem); // 此处出现了问题
if (status != PRO_TK_NO_ERROR)
{
show(status); //显示错误类型
return 0;
}
return 0;
}
// 测试报错类型,并通过UI界面显示错误类型
void show(ProError status)
{
ProUIMessageButton *buttons;
ProUIMessageButton user_choice;
ProArrayAlloc(1, sizeof(ProUIMessageButton),1,(ProArray*)&buttons);
buttons[0] = PRO_UI_MESSAGE_OK;
switch (status)
{
case PRO_TK_GENERAL_ERROR:
ProUIMessageDialogDisplay(PROUIMESSAGE_WARNING,_T("Info"),_T("PRO_TK_GENERAL_ERROR"), buttons, PRO_UI_MESSAGE_YES, &user_choice);
break;
case PRO_TK_E_NOT_FOUND:
ProUIMessageDialogDisplay(PROUIMESSAGE_WARNING,_T("Info"),_T("PRO_TK_E_NOT_FOUND"), buttons, PRO_UI_MESSAGE_YES, &user_choice);
break;
case PRO_TK_BAD_INPUTS:
ProUIMessageDialogDisplay(PROUIMESSAGE_WARNING,_T("Info"),_T("PRO_TK_BAD_INPUTS"), buttons, PRO_UI_MESSAGE_YES, &user_choice);
break;
case PRO_TK_E_BUSY:
ProUIMessageDialogDisplay(PROUIMESSAGE_WARNING,_T("Info"),_T("PRO_TK_E_BUSY"), buttons, PRO_UI_MESSAGE_YES, &user_choice);
break;
case PRO_TK_INVALID_TYPE:
ProUIMessageDialogDisplay(PROUIMESSAGE_WARNING,_T("Info"),_T("PRO_TK_INVALID_TYPE"), buttons, PRO_UI_MESSAGE_YES, &user_choice);
break;
case PRO_TK_NO_CHANGE:
ProUIMessageDialogDisplay(PROUIMESSAGE_WARNING,_T("Info"),_T("PRO_TK_NO_CHANGE"), buttons, PRO_UI_MESSAGE_YES, &user_choice);
break;
default:
ProUIMessageDialogDisplay(PROUIMESSAGE_WARNING,_T("Info"),_T("OTHER."), buttons, PRO_UI_MESSAGE_YES, &user_choice);
break;
}
ProArrayFree((ProArray*)&buttons);
return;
}
选择一个坐标系以后,然后自动隐藏。但是运行后出现错误,ProModelitemHide 的返回值 PRO_TK_INVALID_TYPE.。如下图显示那些:
不知ProModelitemHide的类型应该是什么,有知道的高手解答一下。
|
-
测试结果
|