iCAx开思工具箱

标题: 求助:用对话框画Block不成功 [打印本页]

作者: welchhmq    时间: 2004-11-10 13:41
标题: 求助:用对话框画Block不成功
怎么传不进值
作者: welchhmq    时间: 2004-11-10 14:05
我用六个Real型的对话框接受值但是在传值是却没有值传进来,希望大家帮忙看一下
  
代码:
int BLOCK_apply_cb ( int dialog_id,
             void * client_data,
             UF_STYLER_item_value_type_p_t callback_data)
{  
  UF_FEATURE_SIGN sign = UF_NULLSIGN;
    double corner_pt[3] ={0.0, 0.0, 0.0};  
    char *edge_len[3] = {"100", "100", "100"};  
  char *buffer[3] = {"100", "100", "100"};
    tag_t blk_obj_id;
  UF_STYLER_item_value_type_t position_x, position_y, position_z, length, width, height;
     
  /* Make sure User Function is available. */   
     if ( UF_initialize() != 0)  
          return ( UF_UI_CB_CONTINUE_DIALOG );
  
     /* ---- Enter your callback code here ----- */
    
   position_x.item_attr = UF_STYLER_VALUE;
   position_x.item_id   = BLOCK_POSITION_X;
   UF_STYLER_ask_value(dialog_id, [$position_x)]
  
   position_y.item_attr = UF_STYLER_VALUE;
   position_y.item_id   = BLOCK_POSITION_Y;
   UF_STYLER_ask_value(dialog_id, [$position_y)]
  
   position_z.item_attr = UF_STYLER_VALUE;
   position_z.item_id   = BLOCK_POSITION_Z;
   UF_STYLER_ask_value(dialog_id, [$position_z)]
  
   length.item_attr = UF_STYLER_VALUE;
   length.item_id   = BLOCK_LENGTH;
   UF_STYLER_ask_value(dialog_id, [$length)]
  
   width.item_attr = UF_STYLER_VALUE;
   width.item_id   = BLOCK_WIDTH;
   UF_STYLER_ask_value(dialog_id, [$width)]
  
   height.item_attr = UF_STYLER_VALUE;
   height.item_id   = BLOCK_HEIGHT;
   UF_STYLER_ask_value(dialog_id, [$height)]
  
   corner_pt[0] = position_x.value.real;
   corner_pt[1] = position_y.value.real;
   corner_pt[2] = position_z.value.real;
  
   sprintf(buffer[0], "%f", length.value.real);
   strcpy(edge_len[0], buffer[0]);
  
   sprintf(buffer[1], "%f", width.value.real);
   strcpy(edge_len[1], buffer[1]);
  
   sprintf(buffer[2], "%f", height.value.real);
   strcpy(edge_len[2], buffer[2]);
  
   UF_UI_open_listing_window();
  
   UF_MODL_create_block1(sign, corner_pt, edge_len, [$blk_obj_id )]
    
   UF_terminate ();
  
    /* Callback acknowledged, do not terminate dialog                 */
    /* A return value of UF_UI_CB_EXIT_DIALOG will not be accepted    */
    /* for this callback type.  You must respond to your apply button.*/
    return (UF_UI_CB_CONTINUE_DIALOG);  
  
}
作者: mizzle    时间: 2004-11-10 15:28
别用那个实数型的对话框,用字符串型的,因为在创建block时,本来定义的边长char *edge_len[3] = {"100", "100", "100"}; 就是字符串的。
作者: mizzle    时间: 2004-11-10 15:29
如示




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3