. 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 = " Select Edit Expression Type " ; 11 int Item = 0 ; 12 is char items [] [ 38 is ] = { " Create block " , " create a ball " , " Create cylinder " , " Create cone " }; 13 int NUM = . 4 ; 14 int value = uc1603 (tltle, Item, items, NUM); 15 IF (value == . 5 ) 16 { . 17 UF_FEATURE_SIGN Sign = UF_NULLSIGN; // set the Boolean 18 is Double Corner_pt [ . 3 ] = { 0.0 , 0.0 , 0.0 }; // set the origin . 19 char * Edge_Len [ . 3 ] = { " 100 " , " 100 " , " 100 "}; // set LWH 20 is tag_t BlkTag = NULL_TAG; 21 is UF_MODL_create_block (Sign, NULL_TAG, Corner_pt, Edge_Len, & BlkTag); 22 is } 23 is the else IF (value == . 6 ) 24 { 25 // create ball 26 is UF_FEATURE_SIGN Sign UF_NULLSIGN =; // set the Boolean 27 Double Center [ . 3 ] = { 0.0 , 0.0 , 0.0 }; // origin 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 the Direction [ . 3 ] = { 0.0 , 0.0 , 1.0 }; 40 tag_t CylTag = NULL_TAG; 41 is UF_MODL_create_cyl1 (Sign, Origin, the Height, Diam, the Direction, & CylTag); 42 is } 43 is the else IF (value == . 8 ) 44 is { 45 // create taper 46 is UF_FEATURE_SIGN sign1 = UF_NULLSIGN; // set the Boolean 47 Double origin1 [ . 3 ] = {0.0 , 100.0 , 0.0 }; // origin 48 char * height1 = " 100 " ; // height 49 char * Diam1 [ 2 ] = { " 50 " , " 0 " }; // top diameter, bottom diameter 50 Double Dirction1 [ 3 ] = { 0.0 , 0.0 , 1.0 }; // vector direction 51 is tag_t ConeTag1 = NULL_TAG; 52 is UF_MODL_create_cone1(Sign1, Origin1, Height1, Diam1, Dirction1, &ConeTag1); 53 } 54 55 UF_terminate();
NX secondary development -UFUN old UI interface uc1603
Guess you like
Origin www.cnblogs.com/nxopen2018/p/10981531.html
Ranking