|
- //------------------------------------------------------------------------------
5 m# f. u3 S& }2 P3 Q+ v4 C, T - // Callback Name: apply_cb2 p) E/ `1 q: c$ X" d5 o6 l! s
- // Following callback is associated with the "changeDialog" Styler item." P, ^( P0 g( \' X
- // Input: eventObject - object of UIStyler.StylerEvent class# `5 e# k. q: C# O9 R5 D0 p
- //------------------------------------------------------------------------------% {% m& T* w7 k: {2 _. g6 o- P
- NXOpen::UIStyler::DialogState TriNX::apply_cb(NXOpen::UIStyler::StylerEvent* eventObject)
) Y0 s: m8 m' h! G - {2 b2 Y0 G6 Q' i. z* i. J; |( M
- try
3 K, q& R# @6 }3 W! c# Z& x! t. B - {
# ^* ^3 b6 J( n' W9 Y - // ---- Enter your callback code here -----5 ` Q0 S1 Y7 \& N
- NXString List2v = changeList2->GetSelectedString();1 }5 f* k6 D3 E6 L) u6 N, S
- NXString List3v = changeList3->GetSelectedString();
4 a- U$ i! m6 H+ D0 F2 _ - char *cue="Select Point";
7 ]" d# j3 U3 g9 A9 L- T) e7 H4 _ - UF_UI_POINT_base_method_t base_method;
, \ v: s# P9 a6 S1 A - base_method=UF_UI_POINT_INFERRED;) l3 Q4 S, h% [% ^
- tag_t point_tag;0 d8 Q, h# L4 U- ^% f
- double base_pt[3];1 u5 a4 H6 d% y4 b7 T9 h7 J5 b- d
- int response;5 U* @. J4 M, u. y
/ c$ V/ j+ m; D% v) M- UF_UI_point_construct(cue,&base_method,&point_tag,base_pt,&response);- A. Q, q1 N+ h6 z
- char file_name[] = "d:\\1.prt"; //导入操作的源文件3 Z- g" ^# c& S3 d- s
- UF_import_part_modes_t modes;5 d, c! e7 s7 \: u$ z% `6 t+ z5 O
- modes.layer_mode = 0;: y: T* B: _& d% f. H R
- modes.group_mode = 1;* }, F. L. V! y8 }% L1 g7 P2 s6 ^ v: E
- modes.csys_mode = 0;
# Y9 Y# Q6 j7 U! c1 P" v+ _+ l- U4 ^ - modes.plist_mode = 0;
% F% I6 Q! G7 Q& i: C1 q/ Q - modes.view_mode = 0;
( j1 J6 X0 C e& ? - modes.cam_mode = FALSE; E# f- u% E [
- modes.use_search_dirs = FALSE;5 e8 N, p$ P/ y
- double dest_csys[6]={1,0,0,0,1,0};
T" k9 m& {7 u9 q! M8 Z& B% Y - tag_t group=NULL_TAG;
2 R j( k4 u3 l0 z" s% s4 e - int errorcode=UF_PART_import (file_name, &modes, dest_csys, base_pt, 1, &group);5 J$ o8 r9 y& p8 @3 w, L4 U/ Z
- char msg[132];
% U6 a4 e b/ n2 M - if(errorcode!=0)
, X) y* h2 T% a) c( l9 Q1 @, _* ^ - {, z+ {9 Q' Q9 C2 Z2 h
- UF_get_fail_message(errorcode,msg);! c% N6 T) [5 d" h/ S8 P' {5 d
- uc1601(msg,1);* k& k: S8 f3 {1 W2 U% {
- }
) a! f% R& Z& H" g; U0 D7 r8 J - }/ |. G8 V5 O: A9 ]0 ?
- catch (const NXOpen::NXException& ex)7 T5 ^) `7 V9 \5 [ i/ {. y1 G
- {* w+ a" P. o; [+ t4 E) Q5 i1 [
- // ---- Enter your exception handling code here -----
% g/ Y/ f) n+ \- f# t* a$ G - theUI->NXMessageBox()->Show("UI Styler", NXOpen::NXMessageBox::DialogTypeError, ex.Message());
' s3 z* B2 J! k - }8 u. Y! f* ]3 t1 f
- // Callback acknowledged, do not terminate dialog! m0 p X) Z" n+ o
- // A return value of NXOpen::UIStyler::DialogStateExitDialog will not be accepted# P! [0 ^: J7 L8 e0 T: r
- // for this callback type. You must respond to your apply button.
$ i8 v7 S6 X' y - return NXOpen::UIStyler::DialogStateContinueDialog;
8 C! C6 G K8 ]: }! u0 G - }7 l, I' U* @) F( A7 ~8 c5 K
复制代码 编译通过,但运行时不提示插入点而是直接插入到原点,并且命令无法结束,卡在了如下图提示:1 d" b# Z& ]1 R, L) b- s
& g$ k ]/ G( Q, I2 Y1 B |
-
|