|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- void CMainDlg::OnMesh() - f) O" |1 S" w: _+ ^1 k9 H& m
- {1 ^( _5 L1 Q# a, v; ~/ z
- // TODO: Add your control notification handler code here' t( p+ u! \ t2 s9 l& X
- char cue[] = "please select a face of body";
6 y5 o8 g1 {7 s3 |0 b% J* N - char title[] = "select face";% s4 d1 Y; _0 b( e$ N' o
- int response1;, p* x. T, l2 P7 c5 p/ @+ P$ [
- tag_t view,temp,temp1,point;4 u' \3 E4 {! j% ?
- double cursor[3],matrix[9];2 H( N3 A5 q ]) V! v* w5 S) M3 ^
- int ret=0;
8 \' A$ Q9 g# r. e: N+ A; T - & Q( T( T) ?9 I4 Y
- //UF_UI_specify_screen_position()函数的初始化参数
# P( K5 y) J ~# V - char message[] ="please specify a position";
( u! O3 n+ ^: z0 [* M - int response2;
5 c) j, p! m0 O, F7 _ -
; g7 e% V! \4 x; S- V; x# l - UF_SF_UGs_2d_mesh_parms_t mesh_parms;/ Q: J# l5 z3 e5 m Q
- int num_geoms;//几何体数量9 h* O' b; c5 C+ v6 G! ^2 N
- tag_t geoms_p;//几何体2 ^ [2 n8 R! R6 r$ N
- tag_t mesh_tag=NULL_TAG;* Y: ^% T1 K; A
- tag_t scenario=NULL_TAG;
" g6 O$ ~4 S' F, [! U - tag_t display_part_tag;/ ?! ~: Y7 D9 V2 W$ \3 j9 g
- tag_t proto;
& f1 L8 Y: y( ~2 N! i( q5 C - //最小化当前对话框
/ H9 E9 } u1 G& h - ShowWindow(SW_HIDE);4 b, ?+ q! ?* B0 q+ H: y: F0 h5 }
- int num_bodys=1;6 m' Y) j$ V% T; a3 z0 ]
- tag_t body_tags=NULL_TAG;
% m% L: w6 ^! B7 |% P+ A5 c - int num_desc_lines=1;2 g* |; s. C0 w- S* }
- const char *description="";: w: e3 n5 K5 ~
- tag_t new_fem_tag;
) z2 d2 ?: v* L4 L - display_part_tag=UF_PART_ask_display_part();$ r! _. D& i) Y, k# |% T, B
- tag_t work_tag=UF_ASSEM_ask_work_part();" V2 b% j/ Q" V& N# o
- # H" ]3 K* @ d3 U v
- //mesh_parms.format_mesh=UF_SF_UGS_MESHER_tri3;: o/ |' V# R6 v) G/ ?% l
- mesh_parms.format_mesh=UF_SF_UGS_MESHER_quad4;
F" w' g4 j# @8 x - mesh_parms.element_size=1.0;
6 A, j$ b9 U+ n& b( f - /* mesh_parms.element_size=dDefaultElementSize; */
2 h7 }! a2 C2 Q4 G. s9 K - mesh_parms.edge_maTCh_tolerance=0.508;, g5 z$ I6 D0 n6 M7 H0 b K6 l
- mesh_parms.format_mesh=true;
+ S6 v0 v% O' C- ^ - mesh_parms.attempt_quad_mapping=true;9 z; S# Y( ^4 i, I
- mesh_parms.split_poor_quads=true;3 k1 ] g( X F$ W1 s( A9 N
- mesh_parms.maximum_quad_warp=5;
3 e z4 l1 A+ S: W q6 j - mesh_parms.midnode_option=UF_SF_UGS_MESHER_mixed_midnodes;//$ H1 `/ L$ J; ?& A
- mesh_parms.maximum_midnode_jacobian=5;2 U$ s3 B4 g4 }# _+ ^0 u
- mesh_parms.minimum_face_angle=20;
5 p5 X6 h g; l& q - mesh_parms.surf_mesh_size_variation=50;
3 c$ W1 t, T5 ^4 V - num_geoms=1;! G* I! q8 _, \6 c
- geoms_p=NULL_TAG;9 S7 _4 g) ^+ k6 t W x
- D, d7 B1 G% l' s
/ {. K# |7 w9 Q6 ]! }+ [* I- 5 v/ t' W* G( g# A; u, S& o
- $ l" k. O% Y: p% k' }2 v) C6 v7 y2 x& q
- //把控制权交给UG
+ |+ N0 I r K1 u% @# E! Q, i - ret = UF_UI_lock_ug_access(UF_UI_FROM_CUSTOM);
/ H# y2 ~; `$ l$ C# ]2 y2 @. N - if (ret != UF_UI_LOCK_SET)
$ e, D+ h- [' W1 h4 \+ T+ ]5 D - {
. v1 r& |8 j9 ]. i+ G - UF_UI_set_status("Could not lock Unigraphics");/ Z( s' s7 c# }1 T2 X! ]
- return;' Y' f) b" y q8 T, K* p; [; V
- }
& Y9 l+ j8 P) R: Y o1 Q& \ - ret = UF_UI_select_with_single_dialog(cue,title,, u0 d, [0 ^% Q! x H; \
- UF_UI_SEL_SCOPE_NO_CHANGE, init_proc, NULL,
6 E- ?3 Z6 W! B! d- w- V; @+ h% b: c - &response1, &surf, cursor, &view);//调用面选择对话框) _! O6 }. q' } H/ v/ f! u$ l
- 4 O, ~8 m" Z, }8 g
-
1 r! ?" \1 {2 _5 U+ `* y - UF_UI_unlock_ug_access (UF_UI_FROM_CUSTOM);0 J D# r( f5 k' V" g! s
& r# \8 F) @5 d3 f3 @6 C- int count=0;" I0 u4 h8 `9 [: F* i* T/ z
-
3 J6 n( v& Y. p3 ^: _9 F - //UF_SF_open_scenario("Scenario_1.sim",display_part_tag); 1 m X2 k& i9 L
- if(!ret)
$ T. U; _& S( Y3 W0 K) \; F - {
+ W [2 R! h6 ~9 Z% g4 O; Y - if (response1 == UF_UI_OBJECT_SELECTED ||
- H9 s; f t) }# {; ~ s/ H - response1 == UF_UI_OBJECT_SELECTED_BY_NAME)
2 S @8 Z1 Z# J2 J - {) Q. o$ ~" ~* M9 S8 i& u* w# c/ G, N7 x
- num_geoms=1;
: `& |, q B: I - int error=UF_SF_create_ugs_2d_mesh(&mesh_parms, num_geoms, &surf, &mesh_tag);6 i+ [# Q' b4 b) V9 g
- if(error!=0)
! x/ z. T! Y/ V. b - AfxMessageBox("划分网格不成功");8 _8 Q0 U: |9 P$ `
- if(mesh_tag==NULL_TAG) AfxMessageBox("未生成mesh_tag");
( w3 p* ^) z0 `" X - }( u2 i, P0 w5 M4 ]
- 5 Y W* X- Y# z9 y9 D1 m
- ]- x2 k# |& l8 B+ z
-
: v& u, w. S% W# R# Z - }
9 ]* S1 M5 ^1 \3 U4 E' Q: \ - //UF_free(geoms_p);( `2 p4 H' C* r; i6 P1 @2 O
- UF_DISP_set_highlight(surf,0);UF_SF_display_mesh (mesh_tag); i) ~' t: O3 I6 D0 o9 M, v
- ShowWindow(SW_NORMAL);- I8 {) G( K. i
- }
复制代码 这段函数 在ug高级仿真环境下, 对*.fem文件选中面之后,无法对面进行2D网格划分,UF_CALL提示对象不正确,9 I1 E3 B3 V, Q) Q M/ b
特此前来求教错在哪里了- `) n* E3 F4 u3 L3 f
|
|