|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- void CMainDlg::OnMesh()
! N, U: d/ o- e% v. K: ` - {
" E$ s7 v0 v I& T - // TODO: Add your control notification handler code here
, g2 _+ `9 @; m1 I - char cue[] = "please select a face of body";0 v. h! s7 a7 B+ a+ x, }5 c# Z# b
- char title[] = "select face";0 |9 g8 o! N/ r7 j' [9 l1 V1 A# p# D. G
- int response1;0 Y; o' H2 T8 M& n& E
- tag_t view,temp,temp1,point;) p `6 O |. ]1 r8 \3 W" X% {
- double cursor[3],matrix[9];+ O) J/ P: K3 t- t" z
- int ret=0;
7 d' N- A# o4 n7 y% U7 [
' y& k" a: O s$ c5 p- //UF_UI_specify_screen_position()函数的初始化参数; W* i6 I/ x7 i( ?# \3 c
- char message[] ="please specify a position";
- M' m3 O$ a; F/ ^+ t6 ^/ T* v - int response2;9 [4 o2 x0 Z* k& l
- ; H+ B; T, y& \
- UF_SF_UGs_2d_mesh_parms_t mesh_parms;
( a) T$ e! H: S( d - int num_geoms;//几何体数量/ g6 g* ~' z/ _6 W
- tag_t geoms_p;//几何体
- y; \+ Y1 `$ ]: s( k) g1 ^ - tag_t mesh_tag=NULL_TAG;
, g& R* M5 P# v$ |% B7 ] - tag_t scenario=NULL_TAG;1 q; o8 u' C7 s% ]/ ?/ v1 d% |! U
- tag_t display_part_tag;
# F# w3 v. H8 y+ b% J6 m- Q' V9 L - tag_t proto;7 `' @" b0 c: |( L! {: n, N+ f3 t- @
- //最小化当前对话框6 R; Z8 j- r s
- ShowWindow(SW_HIDE);
4 t" k: w$ d3 e* ~6 R - int num_bodys=1;/ V- Q0 A- K" `8 v; S$ ]& y
- tag_t body_tags=NULL_TAG;3 J; r% b; Y* O/ f, E
- int num_desc_lines=1;
1 \, @ V( j/ s! `- ~ I - const char *description="";
0 y5 r4 q+ y; n3 p$ b - tag_t new_fem_tag; P2 s3 K8 J Z2 b$ g1 U
- display_part_tag=UF_PART_ask_display_part();
- m: P, J# `# Y5 B0 Z% e3 N - tag_t work_tag=UF_ASSEM_ask_work_part();
8 \' X1 m" s; j4 _! L$ k+ U
: I0 _3 W$ i% o$ h/ U4 ~- //mesh_parms.format_mesh=UF_SF_UGS_MESHER_tri3;
/ |0 a7 m! g6 r; D) K - mesh_parms.format_mesh=UF_SF_UGS_MESHER_quad4;
4 a: d# E* g. ^" ~8 f; v - mesh_parms.element_size=1.0;: |2 N- S& N# S0 C/ W
- /* mesh_parms.element_size=dDefaultElementSize; */
& Q0 K2 `& X. S. |3 ]( {* U - mesh_parms.edge_maTCh_tolerance=0.508;- y$ A; V8 K. J: q! C% J8 Y
- mesh_parms.format_mesh=true;
) E( X/ Y6 ?4 \ - mesh_parms.attempt_quad_mapping=true;
# `4 U; S7 j! A% i) @ - mesh_parms.split_poor_quads=true;) F1 k2 F$ C7 U! n) T- o
- mesh_parms.maximum_quad_warp=5;
, {) [# Y6 O: ] - mesh_parms.midnode_option=UF_SF_UGS_MESHER_mixed_midnodes;//
3 E7 H) o$ y: O2 ^ - mesh_parms.maximum_midnode_jacobian=5;0 Z7 l9 N- b; m8 q6 l
- mesh_parms.minimum_face_angle=20;6 [% f/ e7 A3 f) J
- mesh_parms.surf_mesh_size_variation=50;+ A, i, D" r3 f+ o
- num_geoms=1;+ {; e; b- [8 z- O# V. ]$ f ~
- geoms_p=NULL_TAG;) c7 R4 G+ s- \
' n) H( g9 V0 X( m- 9 e w$ w0 |( I4 N0 X
1 r! C7 e9 ?1 B- " L& |. \! h e" N9 d: J
- //把控制权交给UG1 W2 A6 ^3 a! O
- ret = UF_UI_lock_ug_access(UF_UI_FROM_CUSTOM);
+ n/ H4 a4 q# H$ |9 n3 @- H - if (ret != UF_UI_LOCK_SET)) T8 Q; P& w8 q3 c
- { E6 m! c+ P' L2 m8 O! s9 R- z
- UF_UI_set_status("Could not lock Unigraphics");
1 H. h8 v1 ]0 @2 l - return; c$ Z9 y, } z% p' Y- t2 R
- }% ~5 @' P3 s8 b
- ret = UF_UI_select_with_single_dialog(cue,title,& q/ a$ |8 z* Z: g
- UF_UI_SEL_SCOPE_NO_CHANGE, init_proc, NULL,
/ V* X% |: E' j- { - &response1, &surf, cursor, &view);//调用面选择对话框9 M+ Q2 q4 Q- S1 D! R
- 9 Y& n5 O' }0 J
- ' X. }$ m5 @, `
- UF_UI_unlock_ug_access (UF_UI_FROM_CUSTOM);+ E: A( N6 M, q# E* o
- 1 x' E3 k% @& y& C
- int count=0;; y ?, d; s$ x( H
-
6 n+ `9 f/ F* D* m, i) a0 A& [ - //UF_SF_open_scenario("Scenario_1.sim",display_part_tag); * @+ M7 g1 d, }! L4 D9 n
- if(!ret)
0 j1 B; A# E" O$ X7 F! u - {
/ N, V- B2 b! I# y+ k$ m - if (response1 == UF_UI_OBJECT_SELECTED ||; K6 @5 q" E( U! }
- response1 == UF_UI_OBJECT_SELECTED_BY_NAME)$ A, G: X, z/ g- Q# d
- { C1 S* @: a; d2 p/ C- V' f) U( C
- num_geoms=1;
8 [; ?9 J e0 ~! ] - int error=UF_SF_create_ugs_2d_mesh(&mesh_parms, num_geoms, &surf, &mesh_tag);6 h8 e* A" v5 y! z' H% l. w' K1 P
- if(error!=0)3 J+ F1 H2 M) F0 \
- AfxMessageBox("划分网格不成功");
$ m% w, Y; h( l% W* R - if(mesh_tag==NULL_TAG) AfxMessageBox("未生成mesh_tag");
- R! i. D/ ~* ]/ G9 w' j6 z - }4 ^$ R- \$ S4 }5 R6 C" ^
-
) ^; T7 g4 y8 x* z5 [& F1 g - # G* R+ L2 o+ D2 l$ C
-
; G( V" u! G4 Q& _! _2 j) z2 c - } 6 [9 {2 L4 `" z# a
- //UF_free(geoms_p);
3 o) Y9 l/ ?$ o) p8 P8 M+ r - UF_DISP_set_highlight(surf,0);UF_SF_display_mesh (mesh_tag);" w/ L# Z. l E+ d# X
- ShowWindow(SW_NORMAL);6 g( o3 ^: y$ L: A7 _4 I0 b6 x% N
- }
复制代码 这段函数 在ug高级仿真环境下, 对*.fem文件选中面之后,无法对面进行2D网格划分,UF_CALL提示对象不正确,7 v3 ^# n) _7 H! c R$ ?$ D6 [% N
特此前来求教错在哪里了% I. o5 N+ [6 m- p
|
|