|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- void CMainDlg::OnMesh()
7 z6 x+ }/ g4 s% _2 F4 I/ {+ z - {3 P# a& }- w- x0 |; R' Q
- // TODO: Add your control notification handler code here
5 ?$ A( }/ |* o3 ~ - char cue[] = "please select a face of body";& T8 c6 N* W/ F! M
- char title[] = "select face";/ G- J1 M; Y5 n5 C1 I4 m: T
- int response1;8 v& ?2 D! v; L. P/ l! k. A
- tag_t view,temp,temp1,point;
0 [* A* c& h' |) l) v) h+ e$ E+ E0 b - double cursor[3],matrix[9];% S! g0 h; z$ g; h
- int ret=0;9 h7 ?$ b' S8 J% g4 n" Y
9 W; A+ z6 Y! B0 C2 M) K$ t- //UF_UI_specify_screen_position()函数的初始化参数
7 }6 v" v1 B2 ~0 P4 N8 O* e( X0 {' [ - char message[] ="please specify a position"; D9 u% M# {' C# o
- int response2;
' }+ m7 P7 U" D - ( {$ t. {6 |8 _1 A: K2 v9 [1 t
- UF_SF_UGs_2d_mesh_parms_t mesh_parms;3 T0 X9 b' ~ }: ]( z* h
- int num_geoms;//几何体数量: @$ H! s# c4 c/ d
- tag_t geoms_p;//几何体' Q( O; V: N. w0 @
- tag_t mesh_tag=NULL_TAG;
/ S& k/ G# Z+ h& `* _ - tag_t scenario=NULL_TAG;4 R. I0 V3 z, N/ c6 \9 h( z) U- u1 n
- tag_t display_part_tag;% V& d: r1 a* F" K
- tag_t proto;2 E& f8 x# t. g; w
- //最小化当前对话框$ {1 w) M! o1 V8 b# m5 H
- ShowWindow(SW_HIDE);
, M' ?5 ~2 I9 a - int num_bodys=1;7 i( Q7 D% ^$ K/ b6 a& [7 W
- tag_t body_tags=NULL_TAG;# o2 F$ i( T2 `6 c" T. U
- int num_desc_lines=1;
M* g% v- v1 b l9 u - const char *description="";% w9 y2 n, ?" B$ |" Z
- tag_t new_fem_tag;
! U- O) D! V% H1 y8 ?5 w6 g2 a - display_part_tag=UF_PART_ask_display_part();
; `4 J& ~5 ?" l" n( X - tag_t work_tag=UF_ASSEM_ask_work_part();: m4 @- Y* a" R/ v0 @0 Y6 a
; I4 _" q! Z7 A6 u- //mesh_parms.format_mesh=UF_SF_UGS_MESHER_tri3;, I" v( }5 m) _0 J+ {. e$ \
- mesh_parms.format_mesh=UF_SF_UGS_MESHER_quad4;1 i: l! j/ B* R+ @. u1 b# F
- mesh_parms.element_size=1.0;
' N4 w* e) }6 ~6 ?& ? - /* mesh_parms.element_size=dDefaultElementSize; */
6 O9 @% b5 [ c/ m7 Y- ?5 I, d - mesh_parms.edge_maTCh_tolerance=0.508;
( Q; U. Q( V- o7 C! D* L9 h - mesh_parms.format_mesh=true;. l( |; i8 n) W1 j' j$ b
- mesh_parms.attempt_quad_mapping=true;# w' [" _2 ^8 w6 h8 U7 R
- mesh_parms.split_poor_quads=true;' }! c |7 `1 i) ^3 V# }
- mesh_parms.maximum_quad_warp=5;+ X, [# L- A4 _% U8 V
- mesh_parms.midnode_option=UF_SF_UGS_MESHER_mixed_midnodes;//+ a5 g0 P' |! j- T6 `# B
- mesh_parms.maximum_midnode_jacobian=5;
+ r2 h; q; r' c7 P/ y - mesh_parms.minimum_face_angle=20;% u/ }. f1 e9 l7 S
- mesh_parms.surf_mesh_size_variation=50;1 ]6 _ `- ]# H# y# j
- num_geoms=1;+ f' I: C9 }9 N' \; R
- geoms_p=NULL_TAG;9 X3 n( p% s+ ~
- 0 F5 B/ n0 k( G4 U0 `! R" x+ B
- * G% e% u# h5 c6 g! n5 K1 A6 m
4 e' S* M, b. }
b+ q. r# B/ l1 v- M/ d- //把控制权交给UG* V# o, o6 i* k2 H9 b6 ]
- ret = UF_UI_lock_ug_access(UF_UI_FROM_CUSTOM);
& @8 k- p1 H. l8 f. Z6 x! X* Q - if (ret != UF_UI_LOCK_SET)6 F4 Y% F2 E* m: z% B6 Z) ]: Y
- {' X; [3 S( O9 l2 }/ Z1 \6 \! ~/ q
- UF_UI_set_status("Could not lock Unigraphics"); G$ \2 B5 V& _# W& ]! F! s7 P1 F
- return;4 q5 q* `. Q8 f
- }, h {7 Z5 O3 I1 u) X
- ret = UF_UI_select_with_single_dialog(cue,title,* A% ~9 p* L8 @0 U' Q
- UF_UI_SEL_SCOPE_NO_CHANGE, init_proc, NULL,4 G1 Z/ g, ?& N. _- r" w
- &response1, &surf, cursor, &view);//调用面选择对话框
. X4 e! W/ W$ z) o% n: N. a3 F - ' f. p! n, D. h( B2 ?& A
- : r F: [) G* `& k& C5 Y7 J: p: W( l3 R
- UF_UI_unlock_ug_access (UF_UI_FROM_CUSTOM);
4 h3 o Y0 T1 P$ ?8 e Z
( }# o/ A9 o* ~% `6 e3 i% H- d- int count=0;
1 H" X3 g, T4 i7 B' {$ S - # e# s3 [" R! u: F7 ?7 ?
- //UF_SF_open_scenario("Scenario_1.sim",display_part_tag); , T0 B$ d$ r& r0 q% K
- if(!ret)
# A! X x: U. E+ ? - {; P; i! u: R0 X) Y3 g
- if (response1 == UF_UI_OBJECT_SELECTED ||
2 z' y0 m! R, i3 T/ W0 Y - response1 == UF_UI_OBJECT_SELECTED_BY_NAME)3 {- b7 E. d1 [5 W. n
- {" L' }# V5 v! R( R
- num_geoms=1;
3 s2 h C2 u5 M" @ - int error=UF_SF_create_ugs_2d_mesh(&mesh_parms, num_geoms, &surf, &mesh_tag);: Y, S4 r$ O* C, V
- if(error!=0)
! F0 L% V) H' F1 P5 S - AfxMessageBox("划分网格不成功");; I3 I; w' P$ H! l. s; C1 h& t
- if(mesh_tag==NULL_TAG) AfxMessageBox("未生成mesh_tag");
- C% }) G0 W* b) _; q e - }
! O/ s: p7 O( p - 3 Q* U T1 e/ e& I
-
p; ?3 k+ r0 H4 x) F( h - 0 i4 k+ n' k8 I& j
- } & k3 U% G( a' g0 Y3 i1 V1 y
- //UF_free(geoms_p);
) `% k9 ?0 C5 V4 ~ - UF_DISP_set_highlight(surf,0);UF_SF_display_mesh (mesh_tag);" {- O! h+ U- `, }
- ShowWindow(SW_NORMAL);
5 C% f/ c! J6 Q$ d1 c4 H2 C% `8 s - }
复制代码 这段函数 在ug高级仿真环境下, 对*.fem文件选中面之后,无法对面进行2D网格划分,UF_CALL提示对象不正确,. I3 L# t# }7 k% d$ ?# p) u- l& t
特此前来求教错在哪里了8 J5 `- z+ O' s2 G4 N4 ~# E! y, c. R
|
|