|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
0 l7 g4 t: N; L/ `( v, j" w) n3 ?- [8 Y' ~: j
二次开发源码分享: 镜像体
) s: C- u7 i0 s1 F
/ V& S+ c5 u( R; Z Q[mw_shl_code=cpp,true]int IR9027488::apply_cb()
# a, D1 B9 r4 t! N* i! d {( e0 d{2 X/ P( Z' I5 u4 }: \8 n- _
int errorCode = 0;6 z% l/ \6 G" e$ M4 h
try
* r, a( _4 Z! W5 Q {
. O6 U" Z3 h- X3 x5 Z: O // AIW - Begin
+ b7 r) b3 _6 n8 _1 O6 E tag_t body = selection0->GetSelectedObjects()[0]->Tag();
' z! W7 j7 h* A$ E Plane *thePlane = dynamic_cast< lane*>(plane0->GetSelectedObjects()[0]);
0 h. N; R( Q" R8 e" v3 X
" n- K& K; N2 [ NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);
?: r6 t8 O8 X0 q1 {8 z( z NXOpen::Features: atumPlaneBuilder *datumPlaneBuilder1;" q5 O$ @* {2 K( E6 V$ Y
datumPlaneBuilder1 = theSession-> arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);
v/ }# U. r" Z8 q
' b! x3 B+ e2 f+ L, \9 D NXOpen: lane *plane1;
7 W1 q/ d- {6 B7 Y plane1 = datumPlaneBuilder1->GetPlane();
5 e5 J3 E9 ^6 v4 m
4 Z6 l+ f ~9 @' u2 z0 G( q' { plane1->SynchronizeToPlane(thePlane); // this is new in NX11.0.1
. _; P; j. b- F' [7 q3 ~4 n plane1->Evaluate();
$ a2 h) w; v& ], J/ @9 I7 ]5 Y# l0 j7 c1 a7 N
NXOpen::Features::Feature *feature1;
# ]! c* ]/ ^2 J- V" A! b, a feature1 = datumPlaneBuilder1->CommitFeature();% B! Q7 l0 n4 Y
, m8 V& e, f" Q NXOpen::Features: atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features: atumPlaneFeature *>(feature1));
$ X3 H+ z5 M+ C5 W' f q. I' O U NXOpen: atumPlane *datumPlane1;
2 o# l( y& J6 K1 _; @ datumPlane1 = datumPlaneFeature1->DatumPlane();
# c$ h! d* V8 h: \, Y, w# m4 t- i5 l2 H9 k* I8 b
tag_t mirror_feat;
% H! a( G0 Q: X! J1 g errorCode = UF_initialize();
0 C" H& Y- E5 ?$ c* r8 @% ~ if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);
; ~- V6 S w; S& h- K3 }7 U! N4 [4 j' ~. {# _
errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);
& ?: ^! m* q* a if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);' b" E7 H b5 q% z2 F7 U
// AIW - End2 {/ c+ q9 i3 ]5 ?1 |" ?
}
, L) l0 v7 Y" \% A+ e! ^ caTCh(exception& ex)
" Y. {. t, G/ D2 ?1 } {. l) p" Z5 J6 ~! j6 Y- ]
//---- Enter your exception handling code here -----+ x8 b y5 H" ^0 R$ d) P
errorCode = 1;# I/ Z- g- v* s
IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox: ialogTypeError, ex.what());
9 J" u1 c! g8 r, X: s }$ s1 b$ U0 }, d6 n+ l. T
return errorCode;
# x4 ]9 H2 y1 o" T% M5 ?}[/mw_shl_code]& R* |7 F% T8 z
|
|