NX二次开发-UFUN体找面函数UF_MODL_ask_body_faces

摘要:
1NX9+VS201223#include4#include5#include6#include789UF_initialize();1011//创建圆柱12UF_FEATURE_SIGNSign=UF_NULLSIGN;13doubleOrigin[3]={0.0,0.0,0.0};14char*Height="100";1
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 
9 UF_initialize();
10 
11     //创建圆柱
12     UF_FEATURE_SIGN Sign =UF_NULLSIGN;
13     double Origin[3] = {0.0, 0.0, 0.0};
14     char *Height = "100";
15     char *Diam = "50";
16     double Direction[3] = {0.0, 0.0, 1.0};
17     tag_t CylTag =NULL_TAG;
18     UF_MODL_create_cyl1(Sign, Origin, Height, Diam, Direction, &CylTag);
19 
20     //特征找体
21     tag_t BodyTag =NULL_TAG;
22     UF_MODL_ask_feat_body(CylTag, &BodyTag);
23 
24     //体找面
25 uf_list_p_t FaceList;
26     UF_MODL_ask_body_faces(BodyTag, &FaceList);
27 
28     //获取链表数量
29     intCount;
30     UF_MODL_ask_list_count(FaceList, &Count);
31 
32 UF_UI_open_listing_window();
33     //获取链表里的tag
34     for (int i = 0; i < Count; i++)
35 {
36         tag_t FaceTag =NULL_TAG;
37         UF_MODL_ask_list_item(FaceList, i, &FaceTag);
38 
39         //获取面的法向
40         intType;
41         double Point[3];
42         double Dir[3];
43         double Box[6];
44         double Radius[3];
45         double RadData[3];
46         intNormDir;
47         UF_MODL_ask_face_data(FaceTag, &Type, Point, Dir, Box, Radius, RadData, &NormDir);
48 
49         //找圆柱侧面
50         if (Type == 16)//对比面的类型
51 {
52             //对圆柱侧面设置颜色
53             UF_OBJ_set_color(FaceTag, 186);
54 
55             //打印面的法向方向
56             char msg[256];
57             sprintf_s(msg, "面的法向方向为:
X:%.0f
Y:%.0f
Z:%.0f
", Dir[0], Dir[1], Dir[2]);            
58 UF_UI_write_listing_window(msg);            
59 }
60 }
61 
62     //释放内存
63     UF_MODL_delete_list(&FaceList);
64 
65     UF_terminate();

NX二次开发-UFUN体找面函数UF_MODL_ask_body_faces第1张

免责声明:文章转载自《NX二次开发-UFUN体找面函数UF_MODL_ask_body_faces》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇weex-iOS集成spring security session管理下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

NX二次开发-UFUN设置对象(点线面体)的颜色UF_OBJ_set_color

NX9+VS2012 #include <uf.h>#include <uf_obj.h>#include <uf_modl.h> UF_initialize(); //创建块 UF_FEATURE_SIGN Sign = UF_NULLSIGN;//设置布尔 double Corner_pt[3] = {0.0,...

NX二次开发-UFUN打开本地文本文档uc4504

1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_cfi.h> 5 #include <uf_ui.h> 6 7 using std::string; 8 9 10 11...

NX二次开发-UFUN获取整形输入值uc1608

#include <uf.h>#include <uf_ui.h> UF_initialize(); char* cp1 = "提示内容"; char cp2[3][16] = {"菜单1", "菜单2", "菜单3"}; int ip3 = 3; int ia4[3] = {5,6,7}; double ra5[3]; int...

NX二次开发-UFUN获取面的内外边界UF_MODL_ask_loop_list_item

1 NX11+VS2013 2 3 #include <uf.h> 4 #include <uf_modl.h> 5 #include <NXOpen/Face.hxx> 6 #include <uf_ui.h> 7 #include &l...

NX二次开发-Ufun C函数例子目录【更新日期2020.7.5】

外部开发模式exe(不打开NX进行后台操作)以及封装exe传参调用 https://www.cnblogs.com/nxopen2018/p/12386103.html 图为张弛每天幻想开车 飞驰人生-张弛一段很励志的话:当拉力赛车在我身边呼啸而过,我知道!这将是我的一生热爱,我将为此一直奋斗! UF公共类型 1 UF_beg...

油田合并

油田合并 TimeLimit: 1 Second MemoryLimit: 32 Megabyte Totalsubmit: 603 Accepted: 166 Description 某石油公司发现了一个油田。该油田由n*m个单元组成的矩形,有些单元里有石油,有些则没有。单元油田可以通过上,下,左或右连通。在一个单元油田里架设一台采油机,它可以把和...