|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- void CMainDlg::OnMesh() ! o( V8 Z/ ?1 k- m
- {
' y1 s) X L" Z; a2 R. N/ s3 q - // TODO: Add your control notification handler code here
3 B ^ q; @) _* \ - char cue[] = "please select a face of body";
! I+ w% Z* o7 z& i; i. ~1 A - char title[] = "select face";' i5 P$ K& M+ @: i* B* }. y! R
- int response1;
) K5 V9 @6 |/ _( ] - tag_t view,temp,temp1,point;
8 }5 J$ D" H, u - double cursor[3],matrix[9];
2 k" H. L* y0 s3 c) W I - int ret=0;! C, U1 S3 x7 |9 Y& W' F
- V0 |* |) W4 \! i: X- //UF_UI_specify_screen_position()函数的初始化参数
* h' r- F8 G2 u1 m - char message[] ="please specify a position";
0 u! x* ~& {: q# \( ?9 u - int response2;# l8 c; `3 N/ {/ w& \- R
- 8 \& T: }0 l! ^: O& w& D2 z* ^
- UF_SF_UGs_2d_mesh_parms_t mesh_parms;
/ d* p8 D9 k K. j4 o- D4 m - int num_geoms;//几何体数量
$ }9 R. z+ N; l9 s+ _5 l - tag_t geoms_p;//几何体
' }& j& m! y' b2 W, L: y( P - tag_t mesh_tag=NULL_TAG;! n: _9 o1 Y- k8 v
- tag_t scenario=NULL_TAG;% x- N; F% D9 E& v7 m
- tag_t display_part_tag;+ t9 x& R& P7 K [
- tag_t proto;
# u; k# f! J2 i: ~2 E' ` - //最小化当前对话框( }/ B* z0 }# B
- ShowWindow(SW_HIDE);- x% U5 B2 K% k# \9 r. m2 v& \9 ~
- int num_bodys=1;
4 B) e! N8 N' j i - tag_t body_tags=NULL_TAG;
5 ]5 {; I- o" \/ u - int num_desc_lines=1;4 h8 @$ n) t1 k* Y( d/ _ i
- const char *description="";! T. j& N$ g) t7 n; T
- tag_t new_fem_tag;
: z7 y3 b" u& `$ K! ?4 n0 P - display_part_tag=UF_PART_ask_display_part();
$ s. o& v& { h - tag_t work_tag=UF_ASSEM_ask_work_part();
& [( l- G! a4 y
2 E5 l2 j2 @ ~4 `- //mesh_parms.format_mesh=UF_SF_UGS_MESHER_tri3;6 G/ t$ f2 @0 P- i& |
- mesh_parms.format_mesh=UF_SF_UGS_MESHER_quad4;
7 \5 z% y. E1 M; t& l4 g - mesh_parms.element_size=1.0;
) d, N8 d/ _5 c& _ A5 f - /* mesh_parms.element_size=dDefaultElementSize; */ " r( F" ^; i3 m
- mesh_parms.edge_maTCh_tolerance=0.508;+ X% H4 Z# S$ o, c) h
- mesh_parms.format_mesh=true;4 l# p: }6 R/ L" G
- mesh_parms.attempt_quad_mapping=true; p: s$ o& L4 ]6 z
- mesh_parms.split_poor_quads=true;) l5 B0 @: p/ t5 o3 m/ u |
- mesh_parms.maximum_quad_warp=5;
M2 V# L6 x2 `9 H' n - mesh_parms.midnode_option=UF_SF_UGS_MESHER_mixed_midnodes;//% z, }! z: a2 j/ P K
- mesh_parms.maximum_midnode_jacobian=5;
/ C, k8 C7 q! R/ j - mesh_parms.minimum_face_angle=20;) D! \' ^/ n- S3 u" a5 C
- mesh_parms.surf_mesh_size_variation=50;
: Q3 I$ Y+ Y/ x9 r; `/ h5 I I - num_geoms=1;
- D, [ b9 \/ b8 H+ G* A - geoms_p=NULL_TAG;- z P- e, ]0 I- k% k2 ^
+ h. z, u) g0 o: V, f1 E- 6 E% ], p/ y) l. @& X8 I
- 2 Z1 c* W* U" J
; O9 a7 @& M( z. \- `4 B- //把控制权交给UG
7 b% q+ X! O/ X+ k$ S D5 ?$ d& { - ret = UF_UI_lock_ug_access(UF_UI_FROM_CUSTOM);+ r7 D2 m9 q4 z; o! u
- if (ret != UF_UI_LOCK_SET)
# P) R: E1 x$ }% P - {( {) g7 x( U5 H
- UF_UI_set_status("Could not lock Unigraphics");
! |; ~/ C) |0 f, A - return;- s/ t* b2 O* r: J
- }
3 L7 Q9 }8 Z1 h$ W9 {8 Z - ret = UF_UI_select_with_single_dialog(cue,title,
" o, C P8 A. H5 D. d - UF_UI_SEL_SCOPE_NO_CHANGE, init_proc, NULL,
9 m0 T0 A+ L. Q3 A/ }' Y, ?1 T - &response1, &surf, cursor, &view);//调用面选择对话框
1 t% A" h2 P! q, r2 J" S - ) A8 W* J q( W o5 U/ y
-
& D4 s) u! D3 Q9 `% J% i - UF_UI_unlock_ug_access (UF_UI_FROM_CUSTOM);/ _) H* \, X9 s# o& w* L s' S
3 ~" z6 B6 g) V9 K- int count=0;* n& E" Y/ p1 b
- 8 l9 E& H" s* P3 P7 b2 o+ h
- //UF_SF_open_scenario("Scenario_1.sim",display_part_tag); ; o9 s) i$ [3 y% Q/ D
- if(!ret)
" |- g& Y. _5 Z& y4 J3 q" k - {7 r3 p7 M/ m+ q4 a7 \0 f& Z+ W* t
- if (response1 == UF_UI_OBJECT_SELECTED ||, p; z' n4 G/ Q; g8 }
- response1 == UF_UI_OBJECT_SELECTED_BY_NAME)
& d4 Z' B8 G0 j - {. h% L$ b1 m1 G) N" a
- num_geoms=1;
& x4 @- C/ [. a1 C - int error=UF_SF_create_ugs_2d_mesh(&mesh_parms, num_geoms, &surf, &mesh_tag);
- r$ \) T. H2 j. _ - if(error!=0)& I& r9 d; z6 v5 b/ \0 c' m/ D+ r5 K2 S
- AfxMessageBox("划分网格不成功");
% B5 W$ ~9 M4 `- o8 t - if(mesh_tag==NULL_TAG) AfxMessageBox("未生成mesh_tag");
2 D* e2 \! e) j - }2 A& X0 E( y$ a1 I. t
- + E1 J8 |8 v. h0 A
- / t5 r# L8 [- b9 D; K5 \) z
- E8 G( E9 Y8 r7 v
- } 1 [! H6 Z" B" y4 n2 w9 Q
- //UF_free(geoms_p);8 p8 {: g8 k# r. k; y
- UF_DISP_set_highlight(surf,0);UF_SF_display_mesh (mesh_tag);
5 N# ~' n3 g& S+ F/ }4 l+ ` - ShowWindow(SW_NORMAL);
H; @4 D6 n: R; |! H+ c3 I - }
复制代码 这段函数 在ug高级仿真环境下, 对*.fem文件选中面之后,无法对面进行2D网格划分,UF_CALL提示对象不正确,& e: g) c9 X: h
特此前来求教错在哪里了/ Y( O4 g; a, v! T
|
|