|
马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用UF_part_open打开一个prt文件,然后打算用UF_MODL_ask_mass_props_3d输出实体的质量.但是程序运行时出错.
好象是tag of the object is wrong or ....
请高手看一下,特别是UF_MODL_ask_mass_props_3d这一句的&part是否正确?
{
// TODO: Add your application code here
//introduction-----------------------------------
cout<<"*******open a part:\n";
cout<<"*******D:\\HUANGC++\\sample0\\piston.part\n";
char part_name[133]="D:\\HUANGC++\\sample0\\piston.prt";
tag_t part;
UF_PART_load_status_t error_status;
UF_PART_open (part_name,[$part,&error_status )]
if ( part != NULL )
{
int type = 1;
int unit = 3;
int accuracy = 1;
int count = 1;
int zero = 0;
int i;
double acc_val[11] = {.01,0,0,0,0,0,0,0,0,0,0};
double density = 1.0;
double massprop[47];
double massprop_stat[13];
UF_CALL(UF_MODL_ask_mass_props_3d(&part,
count,
type,
unit,
density,
accuracy,
acc_val,
massprop,
massprop_stat));
for (i=0; i<47; i++)
{
printf("[%d] = %8.3f\n",i,massprop);
}
UF_free([$part)]
}
else cout<<"no part opened!!\n";
} |
|