1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_obj.h> 5 #include <uf_modl.h> 6 7 8 UF_initialize(); 9 10 //遍历名字找到面 11 tag_t FaceTag = NULL_TAG; 12 UF_OBJ_cycle_by_name("MAIN", &FaceTag); 13 14 //获取相邻的面 15 uf_list_p_t AdjacentFaces; 16 UF_MODL_ask_adjac_faces(FaceTag, &AdjacentFaces); 17 18 //获取链表数量 19 int FaceCount; 20 UF_MODL_ask_list_count(AdjacentFaces, &FaceCount); 21 22 for (int i = 0; i < FaceCount; i++) 23 { 24 //获取链表里的每一个tag 25 tag_t AdjFaceTag = NULL_TAG; 26 UF_MODL_ask_list_item(AdjacentFaces, i, &AdjFaceTag); 27 28 //设置相邻面颜色 29 UF_OBJ_set_color(AdjFaceTag, 186); 30 } 31 32 //删除链表 33 UF_MODL_delete_list(&AdjacentFaces); 34 35 UF_terminate();