|
- //------------------------------------------------------------------------------
2 m4 l$ a6 G Z9 {9 T' d# p. F1 K - // Callback Name: apply_cb
/ a: e+ n0 E+ I7 c8 I" G - // Following callback is associated with the "changeDialog" Styler item., a0 L% r; y3 a% P8 M
- // Input: eventObject - object of UIStyler.StylerEvent class. [/ H2 J" T2 ~, k# Y# u
- //------------------------------------------------------------------------------
, ^0 A' T! ?! R3 p7 I0 ~ - NXOpen::UIStyler::DialogState TriNX::apply_cb(NXOpen::UIStyler::StylerEvent* eventObject)
/ Q: \* U" y6 H: x. N/ V - {
% G4 X! x: @8 b# b+ F' t - try
! U: C2 l7 `- o. |# H$ O - {( m- `$ c }; V. F; ^9 D* C0 \
- // ---- Enter your callback code here -----; M( O: ~3 Z- @& z3 a* T% F( I9 o+ c
- NXString List2v = changeList2->GetSelectedString();
( r7 K! x; K* a - NXString List3v = changeList3->GetSelectedString();0 W! T6 P4 y7 x2 G/ G) H
- char *cue="Select Point";
b5 F; A# |. r. \ - UF_UI_POINT_base_method_t base_method;
8 s+ Y1 ^1 d( y - base_method=UF_UI_POINT_INFERRED;8 l. F7 g2 ?) e4 ^3 l
- tag_t point_tag;% B4 Z: \' W0 e0 f* z( L& K7 d$ _* H0 ^5 ]
- double base_pt[3];
: C! \. h1 H$ Y. _' y& _ - int response;
; Z7 F- w$ j, x J
9 H) M, t$ u# b* D( Q$ Z- UF_UI_point_construct(cue,&base_method,&point_tag,base_pt,&response);
, N7 K$ Q% r N& `, C1 W5 Y - char file_name[] = "d:\\1.prt"; //导入操作的源文件# [, f! h7 D- u% H) ~# i" c6 g
- UF_import_part_modes_t modes;1 G4 A- v# G$ `7 m! n( N4 v
- modes.layer_mode = 0;
! S( u( A9 l6 F6 j' | - modes.group_mode = 1;
) Q+ V; d" x4 p - modes.csys_mode = 0;
! g/ _ u! x) x" C6 i3 X - modes.plist_mode = 0;: g% C$ n# h& O
- modes.view_mode = 0;
5 h/ ?8 J9 p% H - modes.cam_mode = FALSE;0 L. h: i* V c! Z7 }5 X5 I
- modes.use_search_dirs = FALSE;" E5 M) P* L1 g! |5 a
- double dest_csys[6]={1,0,0,0,1,0};+ S& }$ n2 d5 h" H- a
- tag_t group=NULL_TAG;
* z5 B |2 T8 o$ K H - int errorcode=UF_PART_import (file_name, &modes, dest_csys, base_pt, 1, &group);
6 K7 \/ d _/ K4 P8 b2 O; g9 c - char msg[132];( k8 l$ x; J1 `& [$ q) ]1 L
- if(errorcode!=0)
2 x+ e" m, |( O8 t, P. D3 @( I - { [+ K9 W$ m( i/ o( V
- UF_get_fail_message(errorcode,msg);# h( V: y$ @7 k/ M9 k' S8 K! p4 `
- uc1601(msg,1);
/ H) q' X; \) f - }. c) W7 |) o, y: D3 B6 [8 o
- }6 ]0 Y1 @, b& c1 C* _! h$ y
- catch (const NXOpen::NXException& ex)- M4 H6 N" v) n; k" V5 u, L
- {
4 X) c5 N1 @& ?- J- g$ k* w* [4 Z; \ - // ---- Enter your exception handling code here -----
% @& m9 A* L' v - theUI->NXMessageBox()->Show("UI Styler", NXOpen::NXMessageBox::DialogTypeError, ex.Message());
7 c+ C- |! {8 |! \; z- y - }
6 M6 R$ a$ y7 E3 Z - // Callback acknowledged, do not terminate dialog: L1 P+ ^; _: j4 [, R' Y
- // A return value of NXOpen::UIStyler::DialogStateExitDialog will not be accepted1 U) V$ ~! j a
- // for this callback type. You must respond to your apply button.. n! G& X5 c+ I7 F
- return NXOpen::UIStyler::DialogStateContinueDialog;/ G5 Z1 ?* d3 e
- }
+ C2 O$ ?. ^: [5 x
复制代码 编译通过,但运行时不提示插入点而是直接插入到原点,并且命令无法结束,卡在了如下图提示:
9 I: X8 J2 m3 n+ ]7 h& H7 U3 T- G! B
|
-
|