zoukankan      html  css  js  c++  java
  • NX二次开发-UFUN根据输入的约束创建相对的基准面UF_MODL_create_relative_dplane

    NX9+VS2012
    
    
    #include <uf.h>
    #include <uf_ui.h>
    #include <uf_modl.h>
    
    
        
        UF_initialize();
    
    L10:
    
        //打开单对象选择对话框
        char sCue[] = "请选择实体的平面";
        char sTitle[] = "选择平面";
        int iScope = UF_UI_SEL_SCOPE_WORK_PART;
        int iResponse = 0;
        tag_t tObject = NULL_TAG;
        double adCursor[3];
        tag_t tView = NULL_TAG;
        UF_UI_select_with_single_dialog(sCue, sTitle, iScope, init_proc, NULL, &iResponse, &tObject, adCursor, &tView);
        if (iResponse == UF_UI_OK || iResponse == UF_UI_OBJECT_SELECTED || iResponse == UF_UI_OBJECT_SELECTED_BY_NAME)
        {
            //取消高亮
            UF_DISP_set_highlight(tObject, 0);
    
            //获得面的类型
            int face_type = 0;
            UF_MODL_ask_face_type(tObject,&face_type);
            if (face_type != UF_MODL_PLANAR_FACE)
            {
                uc1601("请选择平面!", 1);
                goto L10;//跳转回去重新选
            }
    
            //根据输入的约束创建相对的基准面
            int num_refs = 1;
            tag_t object_tags[3] = {tObject, NULL_TAG, NULL_TAG};
            int point_select[3];
            int which_plane = 1;
            char* offset_string = "0";
            int num_dplanes = 0;
            tag_t dplane_tag[2];
            UF_MODL_create_relative_dplane(num_refs, object_tags, point_select, which_plane, NULL, NULL, offset_string, &num_dplanes, dplane_tag);
        }
    
        UF_terminate();
    
    Caesar卢尚宇
    2021年2月14日

    作者: 阿飞

    出处: https://www.cnblogs.com/nxopen2018/>

    关于作者:......

    如有问题, 可在底部(留言)咨询.

  • 相关阅读:
    day_5.25py
    day_5.24py
    day_5.22 py
    numpy模块 03
    requests 模块例题示范
    logging模块
    typing 模块
    hashlib模块和hmac模块
    random模块
    time和datetime模块
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/14402046.html
Copyright © 2011-2022 走看看