马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我想通过下面的程序修改特征的参数,可是程序运行时出错!
extern "C" DllExport void ufsta( char *param, int *returnCode, int rlen )
{
/* Initialize the API environment */
int errorCode = UF_initialize();
if ( 0 == errorCode )
{ //打开部件
char part_name[133]="d:\\pm drawing\\canshu.prt";
tag_t part;
int unit=1;
UF_PART_load_status_t error_status;
UF_PART_open (part_name, [$part, &error_status )]
//查询物体的特征
uf_list_p_t feature_tag_list;
tag_t object;
UF_MODL_ask_body_feats (part, [$feature_tag_list )]
tag_t feature_tag=feature_tag_list->eid;
tag_t *exps;
int number_of_exps=0,i;
UF_UI_open_listing_window();
//获得参数
UF_MODL_ask_exps_of_feature(feature_tag, [$number_of_exps , &exps)]
char *string;
for (i=0;i<number_of_exps;i++)
{ //根据参数的标识获得 参数字符串
UF_MODL_ask_exp_tag_string(exps,[$string)]
UF_UI_write_listing_window(string);
UF_UI_write_listing_window("\n");
UF_free(string);
}
UF_free(exps);
string="p0=90";
//string[1]="p0=12";
UF_MODL_edit_exp(string);
UF_MODL_update();
string="p1=20";
//string[1]="p0=12";
UF_MODL_edit_exp(string);
UF_MODL_update();
string="\0";
UF_MODL_ask_exps_of_feature(feature_tag, [$number_of_exps, &exps)]
for (i=0;i<number_of_exps;i++)
{
UF_MODL_ask_exp_tag_string(exps,[$string)]
UF_UI_write_listing_window(string);
UF_UI_write_listing_window("\n");
UF_free(string);
}
UF_free(exps);
/* Terminate the API environment */
errorCode = UF_terminate();
}
/* Print out any error messages */
PrintErrorMessage( errorCode );
}
拜托各位高手帮看看啊!
是不是通过UF_MODL_ask_body_feats (part, [$feature_tag_list )]
tag_t feature_tag=feature_tag_list->eid;
得到feature_tag不对啊! |