1 NX11+VS2013
2
3 #include <uf.h>
4 #include <uf_ui.h>
5 #include <uf_modl.h>
6
7
8 UF_initialize();
9
10 char *tltle = "选择类型编辑表达式";
11 int item = 0;
12 char items[][38] = { "创建块", "创建球", "创建圆柱", "创建圆锥" };
13 int num = 4;
14 int value = uc1603(tltle, item, items, num);
15 if (value == 5)
16 {
17 UF_FEATURE_SIGN Sign = UF_NULLSIGN;//设置布尔
18 double Corner_pt[3] = { 0.0, 0.0, 0.0 };//设置原点
19 char *Edge_Len[3] = { "100", "100", "100" };//设置长宽高
20 tag_t BlkTag = NULL_TAG;
21 UF_MODL_create_block(Sign, NULL_TAG, Corner_pt, Edge_Len, &BlkTag);
22 }
23 else if (value == 6)
24 {
25 //创建球
26 UF_FEATURE_SIGN Sign = UF_NULLSIGN;//设置布尔
27 double Center[3] = { 0.0, 0.0, 0.0 };//原点
28 char *Diam = "100";//直径
29 tag_t SphereTag = NULL_TAG;
30 UF_MODL_create_sphere1(Sign, Center, Diam, &SphereTag);
31 }
32 else if (value == 7)
33 {
34 //创建圆柱
35 UF_FEATURE_SIGN Sign = UF_NULLSIGN;
36 double Origin[3] = { 0.0, 0.0, 0.0 };
37 char *Height = "100";
38 char *Diam = "50";
39 double Direction[3] = { 0.0, 0.0, 1.0 };
40 tag_t CylTag = NULL_TAG;
41 UF_MODL_create_cyl1(Sign, Origin, Height, Diam, Direction, &CylTag);
42 }
43 else if (value == 8)
44 {
45 //创建圆锥
46 UF_FEATURE_SIGN Sign1 = UF_NULLSIGN;//设置布尔
47 double Origin1[3] = { 0.0, 100.0, 0.0 };//原点
48 char *Height1 = "100";//高度
49 char *Diam1[2] = { "50", "0" };//顶部直径,底部直径
50 double Dirction1[3] = { 0.0, 0.0, 1.0 };//矢量方向
51 tag_t ConeTag1 = NULL_TAG;
52 UF_MODL_create_cone1(Sign1, Origin1, Height1, Diam1, Dirction1, &ConeTag1);
53 }
54
55 UF_terminate();