iCAx开思工具箱

标题: 求助传值问题 [打印本页]

作者: welchhmq    时间: 2004-11-8 19:15
标题: 求助传值问题
我通过对话框传值画Block怎么传不了参数,编译没错就是没有结果
int BLOCK_draw_block_cb ( int dialog_id,
             void * client_data,
             UF_STYLER_item_value_type_p_t callback_data)
{
  double corner_pt[3];  
    char   *edge_len[3];  
    tag_t   blk_obj_id ;
  char   *buffer[3] = {"\0", "\0", "\0"};
  UF_FEATURE_SIGN sign = UF_NULLSIGN;  
  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 = "OSITION_X";
   UF_STYLER_set_value(dialog_id, [$position_x)]
    
     position_y.item_attr = UF_STYLER_VALUE;
   position_y.item_id = "OSITION_Y";
   UF_STYLER_set_value(dialog_id, [$position_y)]
    
   position_z.item_attr = UF_STYLER_VALUE;
   position_z.item_id = "OSITION_Z";
   UF_STYLER_set_value(dialog_id, [$position_z)]
  
   length.item_attr = UF_STYLER_VALUE;
   length.item_id = "LENGTH";
   UF_STYLER_set_value(dialog_id, [$length)]
  
   width.item_attr = UF_STYLER_VALUE;
   width.item_id = "WIDTH";
   UF_STYLER_set_value(dialog_id, [$width)]
  
   height.item_attr = UF_STYLER_VALUE;
   height.item_id = "HEIGHT";
   UF_STYLER_set_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], "%s", length.value.strings);
   edge_len[0] = buffer[0];
  
   sprintf(buffer[1], "%s", width.value.strings);
   edge_len[1] = buffer[1];
  
   sprintf(buffer[2], "%s", height.value.strings);
   edge_len[2] = buffer[2];
  
   UF_MODL_create_block1 (sign, corner_pt, edge_len, [$blk_obj_id)]
    
     UF_terminate ();
  
    /* Callback acknowledged, do not terminate dialog */
    return (UF_UI_CB_CONTINUE_DIALOG);  
    
    /* or Callback acknowledged, terminate dialog.    */
    /* return ( UF_UI_CB_EXIT_DIALOG );               */
  
}
作者: wflying    时间: 2004-11-8 21:11
你的DIALOG ID不应该加引号的吧,还有,看你的ID前是否有前缀!




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