QQ登录

只需一步,快速开始

快捷登录

登录 或者 注册 请先

UG爱好者

查看: 1310|回复: 0
打印 上一主题 下一主题

[求助] NX 面无法二次选中问题

[复制链接]

上等兵

Rank: 1

1

主题

14

帖子

185

积分
跳转到指定楼层
楼主
发表于 2020-3-10 10:46:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
读取面的参数,在选择一遍之后,能够正常输出,但是退出之后,这个面就不能被再次选中了,什么原因?求教

int CHANGE_action_0_act_cb_ZM ( int dialog_id,
             void * client_data,
             UF_STYLER_item_value_type_p_t callback_data)
{
    int response=5,irc;
    //int *response2;
    //tag_t *obj2;
    tag_t obj,view;
    double cursor[3]={0,0,0};
    char msg[256];
    char msg2[]="选择锥面:";
    char title[]="选择锥面";
    UF_UI_selection_options_t opts;
    int scope=UF_UI_SEL_SCOPE_WORK_PART;

    int type=0;      
    int norm_dir=0;   
    double point[3];  
    double dir[3];   
    double box[6];   
    double radius;   
    double rad_data;

    UF_UI_mask_t mask;
    opts.other_options = 0;
    opts.reserved = NULL;
    opts.num_mask_triples = 1;
    opts.mask_triples = &mask;
    opts.mask_triples->object_type = UF_face_type;
    opts.mask_triples->object_subtype = 0;
    opts.mask_triples->solid_type = UF_UI_SEL_FEATURE_ANY_FACE;
    opts.scope = UF_UI_SEL_SCOPE_WORK_PART_AND_OCC;

   
     /* Make sure User Function is available. */  
     if ( UF_initialize() != 0)
          return ( UF_UI_CB_CONTINUE_DIALOG );

     /* ---- Enter your callback code here ----- */

     irc=UF_UI_select_single(msg2,&opts,&response,&obj,cursor,&view);

     UF_MODL_ask_face_data(obj,&type,point,dir,box,&radius,&rad_data,&norm_dir);

        UF_UI_open_listing_window();
        sprintf(msg, "判断面类型:%d\n",type);
        UF_UI_write_listing_window(msg);
        sprintf(msg, "判断面内外R:%d\n",norm_dir);
        UF_UI_write_listing_window(msg);
        sprintf(msg, "轴中心 点:%.2f,%.2f,%.2f\n",point[0],point[1],point[2]);
        UF_UI_write_listing_window(msg);
        sprintf(msg, "轴方向:%.2f,%.2f,%.2f\n",dir[0],dir[1],dir[2]);
        UF_UI_write_listing_window(msg);
        sprintf(msg, "半径:%.2f\n",radius);
        UF_UI_write_listing_window(msg);
        sprintf(msg, "rad_data:%.4f\n",rad_data);
        UF_UI_write_listing_window(msg);

     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 );               */

    UF_free(&irc);
}


有奖推广贴子: 

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

 
 
QQ:1359218528
工作时间:
9:00-17:00
 
微信公众号
手机APP
机械社区
微信小程序

手机版|UG爱好者论坛 ( 京ICP备10217105号-2 )    论坛管理员QQ:1359218528

本站信息均由会员发表,不代表本网站立场,如侵犯了您的权利请联系管理员,邮箱:1359218528@qq.com  

Powered by UG爱好者 X3.2  © 2001-2014 Comsenz Inc. GMT+8, 2024-6-27 06:51

返回顶部