|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
i9 L+ a. W2 M
/ l7 h m0 t1 f( c! n# |" G& B二次开发源码分享: 镜像体
( ?2 r9 B# J. c" i7 [9 u; W4 w5 l: _. A3 v0 S
[mw_shl_code=cpp,true]int IR9027488::apply_cb()& G3 h/ x; T# I S" o7 o, X: k
{& ?1 @3 g' [3 E9 d: P( X( d2 C
int errorCode = 0;7 v2 ^3 u0 j( i' g
try
1 r# D4 A% a; s/ W {
$ @ u. U: O7 D$ |6 N/ ~ // AIW - Begin* A/ l$ Z6 k( m8 V7 _8 K- e, ^
tag_t body = selection0->GetSelectedObjects()[0]->Tag();0 o# e2 ~1 r8 Y
Plane *thePlane = dynamic_cast< lane*>(plane0->GetSelectedObjects()[0]);
' g- f# x0 n3 y. e3 g9 i6 v8 \$ h: Q$ w9 l
NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);# A! `3 ^1 }' V1 y( N
NXOpen::Features: atumPlaneBuilder *datumPlaneBuilder1; j4 K/ n" _ Z! K
datumPlaneBuilder1 = theSession-> arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);
: y) k. ?/ }7 g% q. y( z
! a! z( x# }: s# U) P. H% v+ t8 v NXOpen: lane *plane1;
3 b3 \+ K+ O, d6 @5 a plane1 = datumPlaneBuilder1->GetPlane();
3 Q% e5 o! u- u% v0 a
7 a5 z2 O, ~: |' o plane1->SynchronizeToPlane(thePlane); // this is new in NX11.0.1
0 h* \; m0 [ p! e% G) c5 [% b plane1->Evaluate();
; G. t7 ~6 }& C. f
$ ?+ A+ x7 @) W* B% `& m NXOpen::Features::Feature *feature1;
; z/ r3 I5 ~" Y. z. h+ w2 C feature1 = datumPlaneBuilder1->CommitFeature();
" |8 S0 K! y) I( b( G( j+ Q7 X6 P) b; j) d
NXOpen::Features: atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features: atumPlaneFeature *>(feature1));
& X7 H( S, r) t2 M$ B* g NXOpen: atumPlane *datumPlane1;
6 w) B- v$ B9 |( |, m datumPlane1 = datumPlaneFeature1->DatumPlane();
% A* J' E0 R* y
6 Q% I8 {1 x& O tag_t mirror_feat;9 @) ]; @8 z6 d: ^0 \5 B2 L" d, z
errorCode = UF_initialize();
8 E2 i, n3 r: P; A7 } if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);) S2 t0 Q( e4 R( {
- \/ q# N. S% t. \0 j) {$ W5 p4 F errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);
) U4 {% ~. g* d6 y; ` if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);* Y- C+ v! d' D: K' N
// AIW - End
7 N9 H1 l$ G8 z/ ?+ c. e d }6 R4 Y$ n% L9 E$ D. i2 r
caTCh(exception& ex)
. C o" q7 K' M: a {
e5 I* q% Y2 }4 y4 ~ //---- Enter your exception handling code here -----
) k0 ]/ v& D. l; r/ [# Y6 S, n2 C errorCode = 1;( F l! C- c; b' r2 ~7 z) Z1 f
IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox: ialogTypeError, ex.what());
4 f3 r H; ]) I( [+ s U' v }3 X' c- C" ^$ Y' l' F- v. y
return errorCode;
6 b8 u+ S$ N2 F/ `& O}[/mw_shl_code]3 k* y6 }' Y3 N: P
|
|