马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我是想求出实体的体积,程序如下:
tag_t view;
/*
其他参数的定义
*/
char zhp[20];
UF_UI_selection_options_t opts;
UF_UI_mask_t mask = {UF_solid_type, 0, UF_UI_SEL_FEATURE_BODY};
int response = 2;
int type = 1;
int unit = 3;
int accuracy = 1;
int count = 0;
int zero = 0;
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];
opts.num_mask_triples = 1;
opts.mask_triples = [$mask]
opts.scope = UF_UI_SEL_SCOPE_WORK_PART;
if ( UF_initialize() != 0)
return ( UF_UI_CB_CONTINUE_DIALOG );
UF_UI_select_with_single_dialog (
cue,
title,
UF_UI_SEL_SCOPE_WORK_PART,
NULL,
NULL,
&response,
&object,
cursor,
&view );
uc1601("zhp",1);
UF_CALL(UF_MODL_ask_mass_props_3d(view,///应该是在这里出错了
count,
type,
unit,
density,
accuracy,
acc_val,
massprop,
massprop_stat));
sprintf(zhp,"%f",massprop[1]);
uc1601(zhp,1);
但是求得的数值好大,不对。我感觉应该是在view参数这里出错。我必须要用上边的 UF_UI_select_with_single_dialog 这个函数。怎么解决,请各位高手指点,多谢!! |