NX二次开发-UFUN获取边的光顺性UF_MODL_ask_edge_smoothness(找相切面)

 1 #include <uf.h>
 2 #include <uf_modl.h>
 3 #include <uf_obj.h>
 4 
 5 
 6     UF_initialize();
 7 
 8 
 9     //获取面的所有边
10     uf_list_p_t edge_list;
11     UF_MODL_ask_face_edges(42084, &edge_list);
12 
13     //获取链表的数量
14     int count;
15     UF_MODL_ask_list_count(edge_list, &count);
16 
17     for (int i = 0; i < count; i++)
18     {
19         //获取链表里的tag
20         tag_t EdgeTag = NULL_TAG;
21         UF_MODL_ask_list_item(edge_list, i, &EdgeTag);
22 
23         //获取边的光顺性
24         logical is_smooth;
25         UF_MODL_ask_edge_smoothness(EdgeTag, 0, &is_smooth);
26 
27         if (is_smooth == true)
28         {
29             //边找面
30             uf_list_p_t face_list;
31             UF_MODL_ask_edge_faces(EdgeTag, &face_list);
32 
33             //获得链表数量
34             int face_count;
35             UF_MODL_ask_list_count(face_list, &face_count);
36             for (int j = 0; j < face_count; j++)
37             {
38                 //获取链表里的tag
39                 tag_t FaceTag = NULL_TAG;
40                 UF_MODL_ask_list_item(face_list, j, &FaceTag);
41 
42                 //设置颜色
43                 UF_OBJ_set_color(FaceTag, 186);    
44             }
45         }
46 
47     }
48 
49 
50     UF_terminate();

猜你喜欢

转载自www.cnblogs.com/nxopen2018/p/11070051.html