|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- void CMainDlg::OnMesh() / {5 V4 n! X, }* C/ J
- {- i$ ~ m6 x. x3 S' A" U
- // TODO: Add your control notification handler code here7 j* U9 `/ ~1 \ e, \6 N
- char cue[] = "please select a face of body";! `6 a; F" T) T( {7 s2 Y \
- char title[] = "select face";, g- l. {) D" w4 P: Q4 r7 V
- int response1;
4 P* T: @& h7 C* T4 w - tag_t view,temp,temp1,point;6 c$ j) N- Y( j6 u. O x
- double cursor[3],matrix[9];
" z6 ]3 x& n9 C% ?1 f# U2 S - int ret=0;
4 \; B, H$ h2 W+ G/ j+ I/ k* e& l
" V3 t! i* }( K6 T! o3 v6 h- //UF_UI_specify_screen_position()函数的初始化参数
2 G8 O* L" M) g6 d - char message[] ="please specify a position";
5 q7 C6 K4 M( e# v9 M - int response2;' @7 k: y4 {: b4 c8 G6 _: r, f' t, s; R
- ' w7 \7 o4 ?6 R, D' ~$ Y+ F
- UF_SF_UGs_2d_mesh_parms_t mesh_parms;
4 }8 b! K+ a4 ]5 M- z# s9 d - int num_geoms;//几何体数量/ i3 X `% d+ I6 E
- tag_t geoms_p;//几何体
9 ] P9 l4 K% a$ T+ d1 ? - tag_t mesh_tag=NULL_TAG;& n% ]" t# d9 @3 [7 `/ c
- tag_t scenario=NULL_TAG;/ S5 u" j* u$ ?( C$ B, o w! r
- tag_t display_part_tag;
& |% T* t( \% u4 d: k - tag_t proto;0 \- S P7 ]- n7 g+ T+ T
- //最小化当前对话框
0 G ^; S5 ?+ ?- |8 `$ s3 w - ShowWindow(SW_HIDE);
1 W( w7 i9 i7 ~! k4 q - int num_bodys=1;
+ P8 P$ B: X. q/ w$ i& F - tag_t body_tags=NULL_TAG;. ~9 R& A4 T/ L! i; a- R
- int num_desc_lines=1;
( W8 u+ e8 O/ ] - const char *description="";3 R, v `" h/ T' z
- tag_t new_fem_tag;
6 x7 r0 k0 A1 k% Q - display_part_tag=UF_PART_ask_display_part();1 v# n$ |& Z F0 d, l2 K$ [
- tag_t work_tag=UF_ASSEM_ask_work_part();/ H1 P M9 f$ l& ~) {! ]0 n3 y) n& ~5 f5 i
9 B$ h$ X* r" W1 K( l- //mesh_parms.format_mesh=UF_SF_UGS_MESHER_tri3;
( V& a; @+ R! N" a6 E6 \# _/ V r - mesh_parms.format_mesh=UF_SF_UGS_MESHER_quad4;
- Z, T' j% q$ A. V; \9 z - mesh_parms.element_size=1.0;
" `6 p2 N! q8 j- e# N# s+ J - /* mesh_parms.element_size=dDefaultElementSize; */ 6 R1 \* l4 Q. {
- mesh_parms.edge_maTCh_tolerance=0.508;9 q* X) U' o$ O `- t
- mesh_parms.format_mesh=true;
4 ]: D! e4 @3 G; ~1 F - mesh_parms.attempt_quad_mapping=true;, R) l7 G' K/ Q+ X4 `' r9 p3 [- u P
- mesh_parms.split_poor_quads=true;
8 p/ {% ?) B0 [5 W0 C( O! |0 c$ ? - mesh_parms.maximum_quad_warp=5;0 Z2 g6 z" `. [; C
- mesh_parms.midnode_option=UF_SF_UGS_MESHER_mixed_midnodes;//( _& M6 G$ u3 V8 Y0 V
- mesh_parms.maximum_midnode_jacobian=5;
+ j/ B& a0 Y" n2 t - mesh_parms.minimum_face_angle=20;3 ]& }& _: z3 u, I
- mesh_parms.surf_mesh_size_variation=50;% w$ y' }3 I: c% |( c8 d* N& {
- num_geoms=1;7 `6 ?& H) e) N/ A. K2 |
- geoms_p=NULL_TAG;
% w6 O0 \: d {
! D4 u9 \9 _+ _" c- ( B. O+ R5 l" S1 W$ b$ X* b, X
- - D, g! Z/ \% z! G
, x/ C# P, a% x" E* h$ l- //把控制权交给UG7 B: r) G7 k) D( x. C+ p1 I5 m
- ret = UF_UI_lock_ug_access(UF_UI_FROM_CUSTOM);$ s+ P4 g6 }4 @+ z. ]5 d
- if (ret != UF_UI_LOCK_SET)
( N( Q3 G* b5 c Z! {0 ?; E& \ - {
: L+ ?8 m. u; i7 Y' k - UF_UI_set_status("Could not lock Unigraphics");/ v: G- Z% u) \9 ]+ E( @# Q
- return;
" E* S6 v4 u$ P0 g: v6 o - }
& [5 i2 {" K, X( t2 Y! D' W. M+ y - ret = UF_UI_select_with_single_dialog(cue,title,
. o; G: E$ z* A" x - UF_UI_SEL_SCOPE_NO_CHANGE, init_proc, NULL,
( l7 e; H7 d+ o+ S - &response1, &surf, cursor, &view);//调用面选择对话框
1 d- Q8 z) \( m+ n - " P$ a1 j2 W. ?& ?
-
. V7 b4 J) R7 M1 K" _; ` - UF_UI_unlock_ug_access (UF_UI_FROM_CUSTOM);
% b+ L6 Z( Z3 X- Q - $ }. n8 p. c" @% M
- int count=0;& h6 z+ O+ a3 j( n N; Z5 D
-
6 w, v6 T* Q! U& j- @ - //UF_SF_open_scenario("Scenario_1.sim",display_part_tag);
8 a4 A) s% B: T5 V& o* T: k - if(!ret)
0 e' c9 t0 u/ C2 X+ V9 E - {
: g1 R# F; i+ z% S - if (response1 == UF_UI_OBJECT_SELECTED ||+ _8 o/ h" o8 B5 j5 r
- response1 == UF_UI_OBJECT_SELECTED_BY_NAME)
& e, Q0 _6 g& \; n - {
8 a0 |! u6 E" |0 b+ m3 X - num_geoms=1;, ]1 L' H# I) ?" M+ }; y! I
- int error=UF_SF_create_ugs_2d_mesh(&mesh_parms, num_geoms, &surf, &mesh_tag);* {# r( L8 R/ G; v9 j3 k
- if(error!=0)# b/ W8 ?2 O, p; q: L
- AfxMessageBox("划分网格不成功");
& R W$ e, {$ c - if(mesh_tag==NULL_TAG) AfxMessageBox("未生成mesh_tag");
( |: {1 T' F) N5 U- K, n: c- m - }/ _* r, z% k3 r1 a
- " A! I' l' |5 f& \( h) C( e$ y9 g4 R
- 6 H. ^& n. y) P1 V6 z) j4 ~: ~
-
3 I v8 b3 }$ r4 D - }
- ]% W: E" x9 ?' m5 o2 B4 |; `7 z - //UF_free(geoms_p);1 }* B4 y8 ^" b" A4 p% l
- UF_DISP_set_highlight(surf,0);UF_SF_display_mesh (mesh_tag);( Y, c( b8 o. ?) F6 m) v
- ShowWindow(SW_NORMAL);
6 ^; N' [8 N% L. t" Y6 Y - }
复制代码 这段函数 在ug高级仿真环境下, 对*.fem文件选中面之后,无法对面进行2D网格划分,UF_CALL提示对象不正确,
# p) j( ?8 o; j% G0 E特此前来求教错在哪里了
. S+ ]& x( M* p# L5 Z |
|