ft,编辑了一下,结果越改越乱,还不能删除。只好重新发一份了
int CREATE_B_OK_cb ( int dialog_id,
void * client_data,
UF_STYLER_item_value_type_p_t callback_data)
{
//变量声明
char res[256];
logical log;
int i,temp=0; //循环变量
UF_STYLER_item_value_type_t point[3];// 基点坐标
UF_STYLER_item_value_type_t para[3]; // 参数
double basepoint[3];
char *edge_len[3];
UF_FEATURE_SIGN sign = UF_NULLSIGN;
tag_t blk_obj;
/* Make sure User Function is available. */
if ( UF_initialize() != 0)
return ( UF_UI_CB_CONTINUE_DIALOG );
for(i=0;i<3;i++)
{
point[i].item_attr=UF_STYLER_VALUE;
para[i].item_attr=UF_STYLER_VALUE;
}
//进行对应的映射
point[0].item_id=CREATE_B_REAL_1;
point[1].item_id=CREATE_B_REAL_2;
point[2].item_id=CREATE_B_REAL_3;
para[0].item_id=CREATE_B_STR_6;
para[1].item_id=CREATE_B_STR_7;
para[2].item_id=CREATE_B_STR_8;
//访问对应的值
for(i=0;i<3;i++)
{
UF_STYLER_ask_value(dialog_id,[$point[i])]
UF_STYLER_ask_value(dialog_id,[$para[i])]
basepoint[i]=point[i].value.real;
edge_len[i]=para[i].value.string;
}
//创建长方体
temp=UF_CALL(UF_MODL_create_block1(sign, basepoint, edge_len, [$blk_obj))]
//将返回值打印出来
sprintf(res, "%d" , temp);
UF_UI_open_listing_window();
UF_UI_is_listing_window_open([$log)]
if(log)
{
UF_UI_write_listing_window("create_block1()的返回值为:");
UF_UI_write_listing_window(res);
UF_UI_save_listing_window("create_b.txt");
UF_UI_close_listing_window();
}
UF_terminate ();
/* Callback acknowledged, terminate dialog */
/* It is STRONGLY recommended that you exit your */
/* callback with UF_UI_CB_EXIT_DIALOG in a ok callback.*/
/* return ( UF_UI_CB_EXIT_DIALOG ); */
return (UF_UI_CB_EXIT_DIALOG);
} |