|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
- void CMainDlg::OnMesh() 3 a4 n9 U0 l" k6 q( d+ S
- {
8 o0 U/ ^8 g8 ?- m5 R3 X8 T - // TODO: Add your control notification handler code here0 m3 Y' H8 g; n/ B3 s7 L- t) c
- char cue[] = "please select a face of body";
0 e J. `' [- z( Y. S8 ^$ p, h - char title[] = "select face";- F8 V4 n2 O9 p! c H1 B/ y& w) r
- int response1;
: B7 E9 G* r$ U - tag_t view,temp,temp1,point;
6 ~5 F! @8 _' C* c% K$ ^0 \- M - double cursor[3],matrix[9];9 W: ~" i* m& W- Q* \- D
- int ret=0;# z% T1 [& D4 u9 A
& k9 D' x; M& q) I4 A- //UF_UI_specify_screen_position()函数的初始化参数
- j% g4 C0 Z( e' i- N - char message[] ="please specify a position";
( \" j5 l3 j6 d - int response2;
+ r$ u7 W6 ?- F- y) t3 z -
+ k& g. @# }% W& A2 b2 c7 @% h - UF_SF_UGs_2d_mesh_parms_t mesh_parms;
: J4 g( J0 k1 p$ d9 L$ C( v+ }9 Z, A2 H - int num_geoms;//几何体数量
+ L; o8 h+ m6 M9 b R, F - tag_t geoms_p;//几何体
2 z# C7 F5 x; y* S1 U8 B - tag_t mesh_tag=NULL_TAG;
. @& m2 F. v. U3 K' E$ o% W - tag_t scenario=NULL_TAG;( P K) o& v# F! n' C; C. K
- tag_t display_part_tag;
' F$ d3 D( V2 y3 q/ H9 V1 V, L - tag_t proto;8 a+ n4 g, {( x
- //最小化当前对话框1 e# q8 a6 z: Y6 ]3 k7 D' b
- ShowWindow(SW_HIDE);
8 q# z# Q: X* `! k# D, c - int num_bodys=1;- n8 v4 x. R+ s7 ^, s9 p- ^; P
- tag_t body_tags=NULL_TAG;: x" u0 j* L, H4 H0 Z
- int num_desc_lines=1;3 n$ V6 p G- a7 t. V% ^
- const char *description="";
# a! c+ ^) m% G. h6 f0 c: i8 T - tag_t new_fem_tag;
& [ C. c* G7 X* t% `) [, r9 ` - display_part_tag=UF_PART_ask_display_part();
- O- a% f9 Q0 {4 a! r - tag_t work_tag=UF_ASSEM_ask_work_part();
. ]4 B7 J8 X7 b
' L9 R: J" t. M5 G; K- //mesh_parms.format_mesh=UF_SF_UGS_MESHER_tri3;
# m( p/ \9 z H - mesh_parms.format_mesh=UF_SF_UGS_MESHER_quad4;
9 Y6 M# L+ [5 S* R- ^# U: x( n - mesh_parms.element_size=1.0;
* o+ p* g8 Z; y, r& |) n - /* mesh_parms.element_size=dDefaultElementSize; */
9 D* F7 u* W1 \5 _& ?# ^, P - mesh_parms.edge_maTCh_tolerance=0.508;
" L# x$ w! u! b# V1 |9 M - mesh_parms.format_mesh=true;) n* o% e" ] f# ?. A
- mesh_parms.attempt_quad_mapping=true;' R4 z8 w# y5 Z" Z; \2 t8 _3 h% E
- mesh_parms.split_poor_quads=true;$ Q! [8 ^' z" S. B' I
- mesh_parms.maximum_quad_warp=5;
; Q* v2 U5 B1 q6 U" @& _ - mesh_parms.midnode_option=UF_SF_UGS_MESHER_mixed_midnodes;//
: Q/ M. D# h" R9 U - mesh_parms.maximum_midnode_jacobian=5;
6 B) a; K# A, \& [ - mesh_parms.minimum_face_angle=20;, d) X8 q- h* P) p
- mesh_parms.surf_mesh_size_variation=50;
. v% S3 {3 s4 o& H, [( N; ] - num_geoms=1;/ h/ j& z8 r: H8 {. w1 J# I% M( q
- geoms_p=NULL_TAG;+ C! s+ @6 T8 d2 X* _- Z6 a
: V4 p* ]6 X. A/ O- ( N" a* C; ?0 y
K& u& C& `" k d0 ]) U- * q* B& F$ r3 I+ ~8 R* [- V
- //把控制权交给UG
" Q: R: C5 i* J W+ }/ ?( k - ret = UF_UI_lock_ug_access(UF_UI_FROM_CUSTOM);
5 O! v! A6 Y; {/ Y/ T8 X% @ - if (ret != UF_UI_LOCK_SET)
0 J; T, Z; W9 b( T q* u5 j; s - {# H% h( e5 W6 t1 F! @
- UF_UI_set_status("Could not lock Unigraphics");
' ]" |; E% g0 [ - return;
8 D2 b. r; z2 J - }
9 E' G+ M9 V# U: R- V* ? - ret = UF_UI_select_with_single_dialog(cue,title,
! _6 I3 z0 w& \% m: X2 ~ - UF_UI_SEL_SCOPE_NO_CHANGE, init_proc, NULL,
2 i; n9 P$ f' m - &response1, &surf, cursor, &view);//调用面选择对话框
+ C" ^+ D& l$ _ e* e6 r - * e& o+ g/ {2 k: w. F" X8 j
- + J) ?, A4 C( E. v/ }$ s! P
- UF_UI_unlock_ug_access (UF_UI_FROM_CUSTOM);
$ ?0 W, D) r V( \: S m
; J4 y% Z A* b4 ]. k! b- int count=0;
% B& b, T$ `' H# f+ t7 a; K -
1 P3 R0 K! C @, K' u) k* \ - //UF_SF_open_scenario("Scenario_1.sim",display_part_tag);
* q! t$ N! O! }4 ~; S* d8 \! P( m; k - if(!ret)
' c2 S/ P( [/ n0 I6 U6 T% I/ I! A' x - {
1 d$ w4 ]; O) R# t- W1 O: Z - if (response1 == UF_UI_OBJECT_SELECTED ||' J1 o) J1 @# T$ r, C
- response1 == UF_UI_OBJECT_SELECTED_BY_NAME)
6 Z0 Q+ F8 e, d3 D) D - {
?8 S- v# z+ l$ E) B5 [ - num_geoms=1;" a3 f& a; S% u
- int error=UF_SF_create_ugs_2d_mesh(&mesh_parms, num_geoms, &surf, &mesh_tag);
% T& Q5 ?% Q+ y, K) K6 X/ O: Y - if(error!=0)- _, i7 G: v" w. F, B
- AfxMessageBox("划分网格不成功");
" d7 L X& c! W/ I. r - if(mesh_tag==NULL_TAG) AfxMessageBox("未生成mesh_tag");
* h4 Q' h2 M* v& ^ - }2 W" m- u9 A) p6 n( h
-
) P, n; K% @5 K/ l! x -
* i8 `7 ^- } `- y5 I/ o" ? - 3 Y6 p- A% `8 Q; x3 C9 L4 Q: i
- }
6 P4 L. K+ |) Q8 D - //UF_free(geoms_p);
- Q; L8 \1 {& W, p; n1 F9 n- i - UF_DISP_set_highlight(surf,0);UF_SF_display_mesh (mesh_tag);
( ]# z! b+ S# }- U1 h! O* O3 f - ShowWindow(SW_NORMAL);
. g, F2 n" Z, G. N+ ~2 n3 n - }
复制代码 这段函数 在ug高级仿真环境下, 对*.fem文件选中面之后,无法对面进行2D网格划分,UF_CALL提示对象不正确,
' k. v7 d8 V9 V特此前来求教错在哪里了
: L: M0 ~, ], O! i! n |
|