i_ret=UF_MODL_create_fixed_dplane(Datumpoint,direction,&dplane);
i_ret=UF_SO_create_dirr_plane(dpoint,UF_SO_update_after_modeling ,dplane,flip,&Tdirection); i_ret=UF_MODL_create_point_dirr_daxis (dpoint,Tdirection,&daxis_tag ); 上面这几个函数先生成了一个datum plane,然后我定义了该平面的方向,
最后通过点,方向生成datum axis,其中,dpoint,Tdirection,&daxis_tag 这三个参数都是tag_t类型的,调试的时候最后一个函数出错,说是\请问斑竹是何原因呢?
镜射特征中螺纹是否可见是不是由thread.include_instances =UF_MODL_INCL_INSTANCES控制?
a\ L4 o) l+ g;
( Z0 a; a- \\. M( @: E- o/ o/ x为何镜射【mirror】特征中原来的螺纹不见了?
//----------------------- Create boss-----------------------
UF_MODL_create_boss(location1,direction,diam_boss,h_boss,angle,trim_face,&boss_id);
! U1 `5 r' N) h) }1 a0 k }% ]% e) k% g
6 a2 A! \\* S3 @. v3 @+ p* b//------------------- Create a thread on boss---------------------
- w4 p$ b\5 K' h' V
//Get boss faces to use as start face and cylinder face of the thread tag_t s_face,c_face,thread_id; uf_list_p_t list;
0 m1 ? l' Q+ f\0 [: [. p' E1 I4 H* o# y- m [7 d5 o# {5 M
: K8 {# [' K6 D# v# M' v, ^4 b9 m+ k3 C\ UF_MODL_create_list(&list);
4 r9 l1 |7 W* Y1 P# D. P' s UF_MODL_symb_thread_data_t thread;
UF_MODL_ask_feat_faces(boss_id,&list); UF_MODL_ask_list_count(list,&num); for (i=0;i # S; |5 O6 n! {: R2 X9 J H$ ?; a& K( d# _, C0 `8 G( i, B x 8 k* P( I5 r4 a! K UF_MODL_ask_list_item(list,i,&face); i: \\( f; y; n& ? F ' X8 x7 a\ UF_MODL_ask_face_data(face,&type,point,dir,box, &radius,&rad,&sen); 0 ?; P& b. y4 D8 ^, k if ( (type == 22) && (fabs(dir[1]-1.0)< 10e-7) ) s_face = face; //start face if (type == 16) ! w# `3 k2 d) x% t) a- S c_face = face; //cylinder face } # ~6 N f5 ~& F- B v) ^+ | , U3 @; B# S- m! d) A1 L3 n UF_MODL_delete_list(&list); $ l8 M' r4 O# ^! N, q //create thread ; i7 ]7 M& K% ?( z& Z\ ) y6 w. v! a1 f) I8 i Z! u char thread_length[10]; thread_length[0]='\\0'; sprintf(thread_length,\ thread.cyl_face = c_face; thread.start_face = s_face; thread.axis_direction[0]=0; \N( P% b thread.axis_direction[1]=-1; thread.axis_direction[2]=0; m% l, U3 W% ` - A7 |! O% k3 y/ J8 |2 ` & f; C$ _* x7 ]' d0 T( w9 R$ O thread.include_instances =UF_MODL_INCL_INSTANCES; thread.rotation=UF_MODL_RIGHT_HAND; 4 c& ^3 s: L9 Y5 n1 [0 M1 S8 ` ) ]5 \\4 K& W8 B ]3 X thread.length_flag= UF_MODL_FIXED_LENGTH; thread.tapered = UF_MODL_NON_TAPERED; thread.num_starts = 1; thread.length=thread_length; thread.form = \ 3 @2 ~# L2 G7 ]# t1 n6 z6 c/ B, n, w thread.method = \ thread.callout =callout; 9 e% Z8 W' d) ^, C+ |( K' a$ r+ Q thread.major_dia = \ 3 W8 r) O: ~* e A( J' v9 f thread.minor_dia = \ thread.tapped_dia = \ thread.pitch = \ thread.angle = \ UF_MODL_create_symb_thread(&thread, &thread_id); //-----------------chamfer edge of the boss-------------------------- 4 s\ uf_list_p_t boss_face_edge_list; tag_t chamfer_id,mirror_obj; UF_MODL_ask_face_edges (s_face,&boss_face_edge_list); $ Y+ j+ \\: x6 Q; j( ~ 4 C, W! L- [& d. K9 l UF_MODL_create_chamfer (1, \ UF_MODL_delete_list(&boss_face_edge_list); UF_MODL_ask_feat_body(chamfer_id,&mirror_obj); //////////////////////////////////////////////////////////////////////////////////////////// R9 o; D. R* V ///--------------------create mirror feature------------------------------------- double ctr_point[3] = {0.0, 0.0, 0.0}; 5 v @3 I. Y* H* }; [3 P$ e9 R5 D% `3 double directiony[3] = {0.0, -1.0, 0.0}; tag_t mirror_tag,dplane, mirror_body; 9 q) W1 V! o3 i8 Y% ^1 r7 g% `9 m0 y. P( m + G: I2 [6 N `3 G/ O+ P//Create Datum Plane UF_MODL_create_fixed_dplane(ctr_point, directiony, &dplane); & D& V. P: K& e( z8 U ) f: @* n+ m8 B\// Create a mirrored body : M% E/ G% V3 m y UF_MODL_create_mirror_body(mirror_obj,dplane,&mirror_tag); % {+ A# t+ J$ h- h/ f UF_MODL_ask_feat_body(mirror_tag,&mirror_body); + y; B* D- D* H U% c / A9 D, h7 X: H! U U! B4 q) v6 d( D7 X: O\//---------------------unite------------------------------- UF_MODL_unite_bodies(mirror_obj,mirror_body); 9 M3 \\! n3 N9 _# C. H, ]8 o\ 没办法,只好又加了一段,在mirror特征上作多一次螺纹! 7 j/ _: Q. b+ a4 l x; n; d' J/ t( G( Z& K\ //------------------------create a thread feature on the mirror boss---------------- UF_MODL_create_list(&list); - b: d1 G. ^/ o0 D& b0 j % a' C7 [& J: V: { UF_MODL_ask_feat_faces(mirror_tag,&list); UF_MODL_ask_list_count(list,&num); for (i=0;i ! @6 S8 H5 L; g' x9 t9 N UF_MODL_ask_list_item(list,i,&face); UF_MODL_ask_face_data(face,&type,point,dir,box, &radius,&rad,&sen); ! t1 J8 X* m9 B) a if ( (type == 22) && (fabs(dir[1]+1.0)< 10e-7) && point[1]<-10 ) * Z* i: B. ]9 p- ~ s_face = face;//start face if (type == 16) 0 K- x) }% ~1 V$ n3 @( bG0 \\+ M* L% o, ^& } c_face = face;//cylinder face } ~( D: X- w+ g* H9 ^: \\ UF_MODL_delete_list(&list); thread.cyl_face = c_face; thread.start_face = s_face; thread.axis_direction[0]=0; thread.axis_direction[1]=1; / } @8 m, j5 x) a) z\ thread.axis_direction[2]=0; thread.include_instances =UF_MODL_INCL_INSTANCES; thread.rotation=UF_MODL_RIGHT_HAND; thread.length_flag= UF_MODL_FIXED_LENGTH; thread.tapered = UF_MODL_NON_TAPERED; thread.num_starts = 1; 5 G# v a [/ e& s$ A9 Q- R3 U; B; N2 f, q. V# N thread.length=thread_length; thread.form = \ 2 M& m& o4 X. {, t/ B thread.method = \ thread.callout =callout; ) z& `7 t* V7 \\ thread.major_dia = \ thread.minor_dia = \ \ thread.tapped_dia = \ thread.pitch = \ thread.angle = \ & q6 D3 H. ? p. P8 d\ UF_MODL_create_symb_thread(&thread, &thread_id); 斑竹你好.我现在已经明确的知道了我的part文件中两个实体对象的tag_t 和name.现在我想用UF_OBJ_cycle_by_name()这个函数来确定查询出来的tag_t是否和原来的一致, tag_t name_tag=NULL_TAG; UF_OBJ_cycle_by_name (CM_name,&name_tag ); # ^- R& V( g: B while(name_tag!=NULL_TAG) { 2 Q/ X$ h& e6 _8 `' e D3 T! M3 C& w; \\/ H UF_OBJ_cycle_by_name(AM_name,&name_tag); } 当我给name_tag赋值时,函数返回也是为0,当我不赋值时,调试说我内存访问禁止.请问斑竹能否给点提示?谢谢. 我是一个刚开始学习ug二次开发的新手,马上机要进入课题,老板现在让我先看看UG/Open API 中的一些函数,由于是新手,在加上时间比较紧,囫囵吞找的看了一部分,有很多地方不是太明白,在这里先问几个让我很困惑的菜问题 , F8 w$ U( L, E3 ~\3 a\ y+ F\) P, ]7 J4 m3 k 1 T& U5 Z, i& t& J4 X( ]很想得到zzz的帮助::(谢了先:)) $ E! r. m1 _4 p$ f* r# B6 他们是: 6 @8 E5 j' {0 S$ F 1、ufstr()和ufusr()的区别; \ 2、UF_UI_dismiss_dialog_area_2()对这个函数在看DOCUMENT时不是太理解 1 v* q) L$ T\A- \\2 t) L& @; K . R2 w, q' R0 v不知道他和UF_UI_cancle_uf_dialog()的区别?? / @\ 4 D0 b! b5 A7 k! D7 3、UF_UI_get_DA1_coords() UF_UI_get_DA2_coords()着两个函数中DA1和DA2具体指的是什么??以前在UG Documentation Help看到过但是现在找不到了,应为是新手好急啊!!! zzz: 2 n+ e8 z0 Q0 Q Q, G 8 b0 i$ n0 H7 v. 我用你前面讲的回调函数的例子时,编译工程自动生成一文件 EH.H,然后就是如下: e:\\my_source\\eh.h(33) : fatal error C1189: #error : \ 这是在MSDN查到的,可是不知到如何修改下面的错误?请赐教,不胜感激! 0 L! ~: a, g/ H6 F5 x1 Q5 s5 ^8 K. k* E! z$ {. r8 S 7 P/ R( ]. D\Fatal Error C1189 #error : user supplied error message 0 g+ y( G- C4 FThis error message is generated when there is an #error directive in the program. For example: #undef _WIN32 0 W& f* m( N7 V; V( B 1 r+ Z8 m9 ~8 Z8 X+ B#if !defined(_WIN32) 2 i O. T0 I+ P\#error _WIN32 must be defined //error #endif / H3 I' m, m, Y# D O4 q% n int main() { return 0; } 在EH.H中是: #ifndef __cplusplus ' B' ^) p* b$ W# s; R! f& ^ h8 W/ P, {\d0 F+ W# \\\% a4 z9 W; L9 F' @* #error \有错误 ; o9 I, x5 }5 ^# w+ m $ E! s: @* |! I$ S, g; x' }#endif 这又如何修改? 找到 #ifdef MENUBAR_COMMENTED_OUT, 把它及对应的 #endif 删掉。 我用的也是UG NX \如下: , g1 F0 C0 Q4 ^) J$ i\1 i6 E g9 ]* ]6 y& U: T' y7 A VERSION 120 EDIT UG_GATEWAY_MAIN_MENUBAR BEFORE UG_HELP ) H% @2 L; l9 H# G/ s v\ 8 i4 V) Q8 |( K) w' Y% U- p CASCADE_BUTTON UISTYLER_DLG_CASCADE_BTN LABEL 启动对话 C\`3 ~* \\\M END_OF_BEFORE - B. ^! P( r) U( I+ _5 u+ Y( j! ?8 j\ MENU UISTYLER_DLG_CASCADE_BTN BUTTON SEQUENCEPLAN_BTN LABEL 应用菜单 ACTIONS yulu.dlg END_OF_MENU ) d# Z1 [, t) P2 `: y+ H( F48 f; H6 V: m! i2 |6 b, ( [( n% j8 ~- x7 K+ F; s0 k# j9 ^ lindy.men文件放在D:\\Unigraphics NX\\UGALLIANCE\\SITE\\startup目录下 : F z* V, r, \\5 t8 d% e/ A. _1 |# m' B* t( B0 pyulu.dlg文件放在D:\\Unigraphics NX\\UGALLIANCE\\SITE\\application目录下 如果没有程序源代码,而只有*.dlg文件和*.men文件能否在UG环境下利用*.men文件产生的菜单项调出*.dlg对话框呢?(只是此时对话框的各项按钮无实际功能罢了)E:\%ug sec development\%ug二次开发有声视频教程 百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库UG二次开发(4)在线全文阅读。
相关推荐: