|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- void CMainDlg::OnMesh()
: H" b5 S) O4 x( ^7 {: Z - {5 R; N1 z" J7 y6 P. m4 i$ N
- // TODO: Add your control notification handler code here$ H7 O# A5 _; u% [( ~, W7 ?" O
- char cue[] = "please select a face of body";, e, S- m" q+ u" M8 ?
- char title[] = "select face";
6 Q V7 p4 t* V, c - int response1;
5 d# p2 i- w. p* {* D$ @ - tag_t view,temp,temp1,point;/ X3 W6 k& J/ h, Z" \& X
- double cursor[3],matrix[9];
2 U; K9 c J, s) d/ N1 m - int ret=0;
5 ~' y2 v# T, g, K' S
' B9 U% M: P; R/ P. a- //UF_UI_specify_screen_position()函数的初始化参数3 o& j6 ~: Y+ M% }# O9 w8 m Z
- char message[] ="please specify a position";
1 q& u4 e" b5 V; I; n - int response2;
6 p! z* n( ]" V& I- g9 z+ z7 J4 G - / y1 x y! t( @) J& m* n# H
- UF_SF_UGs_2d_mesh_parms_t mesh_parms;
3 B: Q# G& W8 t# n9 I - int num_geoms;//几何体数量
2 z! f4 V; r! w9 x% ^; T8 _. T - tag_t geoms_p;//几何体5 Q1 b. j8 F% t; B& h
- tag_t mesh_tag=NULL_TAG;
& q$ T( Z S$ L7 k - tag_t scenario=NULL_TAG;) H, z0 Y) f4 ?7 g4 s1 f P
- tag_t display_part_tag;2 N) h4 X7 m+ @$ I0 V1 F
- tag_t proto;
8 W$ A5 R# s# P8 O0 K# U - //最小化当前对话框% l" ^6 u! i+ Y9 H
- ShowWindow(SW_HIDE);7 c7 k' q1 o# j& f$ N Y, O- L; b
- int num_bodys=1;
+ g* Y5 w3 W' ?( a( ^ - tag_t body_tags=NULL_TAG;- ^, b7 p. e7 j' M- V8 @
- int num_desc_lines=1;4 j2 c: B) [$ |# B9 w
- const char *description="";* c( e# P% A' @3 f5 Y7 o+ J
- tag_t new_fem_tag;7 C& R( x" D5 b. C
- display_part_tag=UF_PART_ask_display_part();
$ o3 m* _' c* m$ l# j3 o( U - tag_t work_tag=UF_ASSEM_ask_work_part();: [) X# u, m/ W H# h3 d& p( R
- 4 L& D1 F2 a4 Z9 |$ c5 c- v. k& n9 f
- //mesh_parms.format_mesh=UF_SF_UGS_MESHER_tri3;
6 _. W; ]* D( Y5 b% `: C: _ - mesh_parms.format_mesh=UF_SF_UGS_MESHER_quad4;* l5 l( X% u+ X9 q& ~1 a6 p
- mesh_parms.element_size=1.0;# d P* v& @) W/ H& a4 B0 z
- /* mesh_parms.element_size=dDefaultElementSize; */
! g# a7 i/ G& b. A: q - mesh_parms.edge_maTCh_tolerance=0.508;
, h( _) R5 T5 P0 |( b) N - mesh_parms.format_mesh=true;
2 f) Q6 z( |0 r: S" O" H - mesh_parms.attempt_quad_mapping=true;7 X" f/ y+ B: q
- mesh_parms.split_poor_quads=true;, l$ d8 e5 G( |' `! T
- mesh_parms.maximum_quad_warp=5;3 r5 J" d4 B% B% D
- mesh_parms.midnode_option=UF_SF_UGS_MESHER_mixed_midnodes;//
8 |+ @* W/ J! ]# s# Z# W. E - mesh_parms.maximum_midnode_jacobian=5;
! r' |( s, p' {6 F - mesh_parms.minimum_face_angle=20;
. M8 t& S. x" r+ U% a4 W' R c7 i - mesh_parms.surf_mesh_size_variation=50;
, b! k0 C9 n: o: J) x. H) @ - num_geoms=1;3 J, B& a4 \3 M; W( Y# x
- geoms_p=NULL_TAG;
% Y% R4 Q, L% w# D; v- t
9 m+ n8 i9 t o/ G) {
+ C% f& Y9 |9 m. c: U" @+ R
: u( |+ _( F( f6 G+ J* l7 J9 I c
7 w W6 v+ ]$ r% E' Y( p0 E- //把控制权交给UG3 j7 c6 |) i2 p2 N
- ret = UF_UI_lock_ug_access(UF_UI_FROM_CUSTOM);
* B4 ]) ?) X5 f, C6 v ~ n - if (ret != UF_UI_LOCK_SET)
' u- g: _5 b# l# c1 R$ B, }' q5 U2 c, X - {4 I: J; J1 T; w( y+ o; Q& x
- UF_UI_set_status("Could not lock Unigraphics");
" g3 S0 H3 I! t7 I. l - return;
8 e) k4 r& w7 y8 }8 o. X3 w - }+ H% R4 X1 v- `1 h1 e
- ret = UF_UI_select_with_single_dialog(cue,title,4 W( y' g) v' H
- UF_UI_SEL_SCOPE_NO_CHANGE, init_proc, NULL,1 `/ A# b& ^$ ^9 r
- &response1, &surf, cursor, &view);//调用面选择对话框
/ m9 {& `6 I+ [0 d6 ? - + k* y: v; q, P
-
& D) K( \1 c- ^/ E9 k. S& s/ O - UF_UI_unlock_ug_access (UF_UI_FROM_CUSTOM);
% S z v9 m$ A3 V2 w m8 Y9 f - ! c Z+ b+ ]; [* Z8 C
- int count=0;' W( e; ^, ]0 c
-
/ q/ C. n! Y6 f) }" o" x$ A7 l* C - //UF_SF_open_scenario("Scenario_1.sim",display_part_tag);
1 f, [$ \- q( e3 w, i1 _ - if(!ret)
- Z2 @( X5 k( }6 o: q5 y - {! y4 s- W: N1 C
- if (response1 == UF_UI_OBJECT_SELECTED ||2 f& m! }5 A) X- v* @2 f
- response1 == UF_UI_OBJECT_SELECTED_BY_NAME)
" }( M8 [+ N: F% Z8 l - {
) N- v- h2 U3 l) [* _' n - num_geoms=1;" ]% T" J6 D4 ~( W
- int error=UF_SF_create_ugs_2d_mesh(&mesh_parms, num_geoms, &surf, &mesh_tag);% S" x+ N1 H9 ?
- if(error!=0). g" D+ ~0 H- R2 X# X
- AfxMessageBox("划分网格不成功");
% i- f5 @& d: c - if(mesh_tag==NULL_TAG) AfxMessageBox("未生成mesh_tag");# l0 E, m" Q2 K9 R( M T
- }4 P& D: d; X, ~# e8 R
-
W( W$ i$ p) h' r- P2 h8 H -
3 \" q$ J4 ?5 H! n5 O" v7 r - % ~: q( I5 ^7 t- S. R% q
- } - G5 m: ^6 s6 d( h+ z6 n6 n
- //UF_free(geoms_p);
2 L) G# L5 u( Q2 Q. n& \ - UF_DISP_set_highlight(surf,0);UF_SF_display_mesh (mesh_tag);% u) |3 P/ x2 s- a3 p
- ShowWindow(SW_NORMAL);+ Y. n5 H* X. R, }: O
- }
复制代码 这段函数 在ug高级仿真环境下, 对*.fem文件选中面之后,无法对面进行2D网格划分,UF_CALL提示对象不正确,( Z/ j, W) V( P5 s2 e5 V/ {
特此前来求教错在哪里了
8 s9 ~4 x L6 B: C3 N: l. y2 B; v |
|