• NX二次开发-UFUN特征找xxx UF_MODL_ask_feat_xxx等函数(待补充)


     1 NX9+VS2012
     2     
     3     #include <uf.h>
     4     #include <uf_modl.h>
     5     #include <uf_obj.h>
     6     #include <uf_ui.h>
     7 
     8     UF_initialize();
     9 
    10     //创建块
    11     UF_FEATURE_SIGN Sign = UF_NULLSIGN;
    12     double CornerPt[3] = {0.0, 0.0, 0.0};
    13     char *EdgeLen[3] = {"100", "100", "100"};
    14     tag_t BlkTag = NULL_TAG;
    15     UF_MODL_create_block1(Sign, CornerPt, EdgeLen, &BlkTag);
    16     
    17     //==============================================
    18 
    19     //特征找体
    20     tag_t BodyTag = NULL_TAG;
    21     UF_MODL_ask_feat_body(BlkTag, &BodyTag);
    22 
    23     //把体设置成红色
    24     UF_OBJ_set_color(BodyTag, 186);
    25 
    26     //================================================
    27     /*
    28     //特征找边
    29     uf_list_p_t EdgeList;
    30     UF_MODL_ask_feat_edges(BlkTag, &EdgeList);
    31 
    32     //获取链表数量
    33     int Count;
    34     UF_MODL_ask_list_count(EdgeList, &Count);
    35 
    36     UF_UI_open_listing_window();
    37     char msg[256];
    38     sprintf_s(msg, "当前体有%d条边
    ", Count);
    39     UF_UI_write_listing_window(msg);
    40     
    41     for (int i = 0; i < Count; i++)
    42     {
    43         tag_t EdgeTAG = NULL_TAG;
    44         UF_MODL_ask_list_item(EdgeList, i, &EdgeTAG);//获得每条边的tag        
    45         sprintf_s(msg, "tag=%d
    ", EdgeTAG);
    46         UF_UI_write_listing_window(msg);
    47     }
    48     //删除链表
    49     UF_MODL_delete_list(&EdgeList);
    50     */
    51     //===========================================
    52     /*
    53     //特征找方向
    54     double DirX[3];
    55     double DirY[3];
    56     UF_MODL_ask_feat_direction(BlkTag, DirX, DirY);
    57     
    58     UF_UI_open_listing_window();
    59     char msg[256];
    60     sprintf_s(msg, "%f, %f, %f
    %f, %f, %f", DirX[0], DirX[1], DirX[2], DirY[0], DirY[1], DirY[2]);
    61     UF_UI_write_listing_window(msg);
    62     */
    63     //==============================================
    64     /*
    65         //特征找面
    66         uf_list_p_t FaceList;
    67         UF_MODL_ask_feat_faces(BlkTag, &FaceList);
    68 
    69     //获取链表数量
    70     int Count;
    71     UF_MODL_ask_list_count(FaceList, &Count);
    72 
    73     UF_UI_open_listing_window();
    74     char msg[256];
    75     sprintf_s(msg, "当前体有%d个面
    ", Count);
    76     UF_UI_write_listing_window(msg);
    77 
    78     for (int i = 0; i < Count; i++)
    79     {
    80         tag_t FaceTAG = NULL_TAG;
    81         UF_MODL_ask_list_item(FaceList, i, &FaceTAG);//获得每个面的tag        
    82         sprintf_s(msg, "tag=%d
    ", FaceTAG);
    83         UF_UI_write_listing_window(msg);
    84     }
    85     //删除链表
    86     UF_MODL_delete_list(&FaceList);
    87     */
    88     //================================================
    89     /*
    90     //获取特征的时间戳记名字
    91     char *FeatureName;
    92     UF_MODL_ask_feat_name(BlkTag, &FeatureName);
    93     
    94     UF_UI_open_listing_window();
    95     UF_UI_write_listing_window(FeatureName);
    96 
    97     UF_free(FeatureName);
    98     */
    99         UF_terminate();
  • 相关阅读:
    Movement Type
    Excel制表技巧
    [转]MM移动类型的配置相关的系统表,举例说明SAP是如何根据配置抛帐的
    Microsoft Excel:Automatically color alternating rows(columns)
    eBook试载(1):Workbook对象与示例(1)
    辨析:would rather 和 prefer
    Serial Number Management In SAP SD
    <摘录>NAL格式
    linux服务简介关闭不需要的Linux服务
    <摘录>PS和TS流的区别
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/10975836.html
Copyright © 2020-2023  润新知