|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- void CMainDlg::OnMesh()
" V, \; f9 p, z& l6 m - {5 E" k0 h5 B- P0 R- `0 P; [2 K7 ~
- // TODO: Add your control notification handler code here; Z4 E2 d" U# } ?9 o
- char cue[] = "please select a face of body";: o S& p2 u3 j, j9 M4 w
- char title[] = "select face";; X+ ~: Z' v! X( o! V% }+ F
- int response1;
4 }& O' N" ~5 S' o( [) B - tag_t view,temp,temp1,point;7 r4 G! D8 k0 {! E; g4 W* S9 j
- double cursor[3],matrix[9];- r( G+ b$ D4 k
- int ret=0;
! ^6 W, s8 R* i( i4 }8 {0 `# x
: N: \1 Q- l. @1 g- k- U- //UF_UI_specify_screen_position()函数的初始化参数& Q. p0 }/ ]9 w0 g7 X
- char message[] ="please specify a position";
, d3 F4 q8 F/ x) V/ o# e* _, p3 { - int response2;
: h+ R) m- B1 z - ( I/ r! s6 N: ]* X+ @- m: E( e5 \
- UF_SF_UGs_2d_mesh_parms_t mesh_parms;
/ i+ }& x) ] C4 P Q' ^) S8 u: Z - int num_geoms;//几何体数量
- f' A& r9 l0 Q3 @ - tag_t geoms_p;//几何体- |- h6 H- V1 s
- tag_t mesh_tag=NULL_TAG;
6 o1 _' y2 G/ i$ I' J - tag_t scenario=NULL_TAG;& c+ l6 f8 s4 } f6 ^5 y
- tag_t display_part_tag;$ a' `) I+ G+ M/ U
- tag_t proto;+ r6 U; Q; ` O8 Y2 V
- //最小化当前对话框3 J6 |# z! W; b1 u5 R, R# Q+ L
- ShowWindow(SW_HIDE);
( ~; J, f! u2 N+ g% M - int num_bodys=1;$ s4 N3 B9 t. r- u* H4 c
- tag_t body_tags=NULL_TAG;, H4 G' H3 s5 U6 D3 c, b7 P
- int num_desc_lines=1;
- d2 M" r1 f k, c: o2 y - const char *description="";
8 w! L; C5 E( ^, v6 t - tag_t new_fem_tag;
: m' X+ w, \7 U5 x% N, n; j - display_part_tag=UF_PART_ask_display_part();' S) h3 O8 o. D6 q" @- `: m
- tag_t work_tag=UF_ASSEM_ask_work_part();
. k' \: s7 l) C" \7 z
$ C' J& H( y+ Y- //mesh_parms.format_mesh=UF_SF_UGS_MESHER_tri3;5 J) o2 P9 J- {* y+ H( H
- mesh_parms.format_mesh=UF_SF_UGS_MESHER_quad4;% A( q. |( n4 l8 x4 L* q
- mesh_parms.element_size=1.0;6 V% _3 @) u$ P
- /* mesh_parms.element_size=dDefaultElementSize; */ ' Y+ _* z& f+ e2 d: u5 T3 P$ H/ Y
- mesh_parms.edge_maTCh_tolerance=0.508;' d4 |/ h. O/ _ y9 ?1 ?! s0 D; \. M
- mesh_parms.format_mesh=true;
( k& E- }* O4 r# O6 f - mesh_parms.attempt_quad_mapping=true;/ J0 }' f& x( c, X
- mesh_parms.split_poor_quads=true;
* F* Z% m2 }0 _6 p: J7 [7 m3 V - mesh_parms.maximum_quad_warp=5;3 P! @; e, h/ b- v, B
- mesh_parms.midnode_option=UF_SF_UGS_MESHER_mixed_midnodes;//, V2 L! [' C" w5 u! F" X' f
- mesh_parms.maximum_midnode_jacobian=5;2 j" Q/ ~9 T* t, A( w- A2 ~
- mesh_parms.minimum_face_angle=20;. P+ l( V. y' D. U8 Z+ W
- mesh_parms.surf_mesh_size_variation=50; o! S( x( u4 V; V
- num_geoms=1;% j- k9 ?3 m, ~. ]8 z: ~
- geoms_p=NULL_TAG;# v' P# {2 L7 A0 W) L0 l9 y
- , `7 B2 S4 ` f4 ]" t
5 c1 C$ i; f3 d# q" J- 2 C: {( S$ ?3 k9 f1 P$ z+ S
; \' Q# ^% _4 O6 z. \: K S+ D8 H! r- //把控制权交给UG' k% L" |/ q. ^9 T' k7 x& J* U
- ret = UF_UI_lock_ug_access(UF_UI_FROM_CUSTOM);
1 {8 h* B* l) x+ V3 _' y - if (ret != UF_UI_LOCK_SET)5 t1 y4 S8 I" ^5 X" h& H% w3 S
- {0 Q6 U% {8 w1 U
- UF_UI_set_status("Could not lock Unigraphics");
, j' N* k" ~/ K- v! {) v - return;+ V- Z) s8 a( e4 m! l
- }
; U7 D0 a6 t4 i* U* Z - ret = UF_UI_select_with_single_dialog(cue,title,
: l) E2 d) ~& w/ X0 N; n6 L - UF_UI_SEL_SCOPE_NO_CHANGE, init_proc, NULL,
7 W# L+ t- c, R8 ?) c1 ~( D - &response1, &surf, cursor, &view);//调用面选择对话框; S" a6 p2 [" m1 y1 V0 ~
- 5 A+ G5 L5 j+ f$ h( h
- + S. F [/ _& i- j1 ~' @0 X
- UF_UI_unlock_ug_access (UF_UI_FROM_CUSTOM);; t. x8 r& i- S' W1 D6 {' K' b
2 l- O" C+ U* o& F; I0 a- int count=0;; X v" t$ L8 U9 N/ M/ {* v9 k
-
8 w" [% z$ B( F - //UF_SF_open_scenario("Scenario_1.sim",display_part_tag);
) M$ \) w. b) V7 ] - if(!ret)% g4 ]7 G! Y' L
- {
4 \! v: N) I$ _4 | - if (response1 == UF_UI_OBJECT_SELECTED ||- k& k, l; g/ I; i' g3 l0 v- \3 A
- response1 == UF_UI_OBJECT_SELECTED_BY_NAME)5 q' |+ |' [' j' F
- {" W) m# e: W$ w1 `- D
- num_geoms=1;
% n$ d T4 |- } {1 C - int error=UF_SF_create_ugs_2d_mesh(&mesh_parms, num_geoms, &surf, &mesh_tag);
) y: S9 y& p. n) L$ b! o" D - if(error!=0)
: D% M E3 c- ?+ `* P% k, c5 a7 V( f4 S - AfxMessageBox("划分网格不成功");
! O9 R! s5 k* Z4 b - if(mesh_tag==NULL_TAG) AfxMessageBox("未生成mesh_tag");
. |; ~( Y" z3 c; c1 w - }
; W7 {$ i' s# W' C$ ?4 X/ J - + k ^. {5 W! ~2 s! p6 R
- 1 W J& ~! B/ v, Y- h) I- G+ I
- / ]* L- D# Q2 @) X
- } " O% g9 P+ r- Q! Z) d
- //UF_free(geoms_p);
& ` q2 R7 c" g( \ - UF_DISP_set_highlight(surf,0);UF_SF_display_mesh (mesh_tag);
6 ~2 `9 r2 T$ d: j - ShowWindow(SW_NORMAL);) `$ p" f; ?+ u- O3 q# w d
- }
复制代码 这段函数 在ug高级仿真环境下, 对*.fem文件选中面之后,无法对面进行2D网格划分,UF_CALL提示对象不正确,
: a& r1 D( O& C4 |, L特此前来求教错在哪里了
1 ]; A& p8 x! Q. X |
|