|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
% I1 z, u( i$ ] R& ^" O, ]
. r/ T, l" [, G$ C" `) A
二次开发源码分享: 镜像体 2 P7 P+ w; ~$ L/ u. t( ]6 Y |
; h6 E! A# t* @[mw_shl_code=cpp,true]int IR9027488::apply_cb()4 Z. y% E2 ^$ p! L8 m
{
) e8 |' E- P/ c0 W P, l7 } int errorCode = 0;$ G5 e2 {0 {( d' L
try- o( S, E1 j; U5 B
{ y/ N$ }) N' E' N5 ^$ w9 i
// AIW - Begin
3 w, M2 w+ {& @5 m2 V) A% l* k tag_t body = selection0->GetSelectedObjects()[0]->Tag();8 Q" u+ j, t4 \) r4 u
Plane *thePlane = dynamic_cast< lane*>(plane0->GetSelectedObjects()[0]);
2 Z8 O3 I% {5 o# o, y% ]3 _8 \3 H/ Z4 `
NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);
% d- U+ p. G& I NXOpen::Features: atumPlaneBuilder *datumPlaneBuilder1;
% ]( `! U8 n$ M& s2 o datumPlaneBuilder1 = theSession-> arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);
) b" l4 }* H1 L+ `( M
6 m7 V5 u: w+ q, N NXOpen: lane *plane1;
y0 I) n0 h; {: z, A plane1 = datumPlaneBuilder1->GetPlane();1 V0 V" n- ]6 N: ]
8 v5 _0 `: m% H$ Z, U
plane1->SynchronizeToPlane(thePlane); // this is new in NX11.0.1
1 S* W& O7 c* k* `) U9 s6 g plane1->Evaluate();( u k: F0 I @0 F5 _
* E9 g, c& y: G) d! l: W8 b NXOpen::Features::Feature *feature1;4 l! r1 [: N" Z) B+ D+ y$ g7 L
feature1 = datumPlaneBuilder1->CommitFeature();7 R; E$ l- K) J& z- I$ G. W% i# G
7 B, u8 p. {, p( R9 y7 q
NXOpen::Features: atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features: atumPlaneFeature *>(feature1));
* n: E, ^/ U* J5 }& C" s NXOpen: atumPlane *datumPlane1;7 w8 ]: Z$ l( f( }; i7 \
datumPlane1 = datumPlaneFeature1->DatumPlane();
+ [. B9 j# Z- G- ^+ H% r0 v
% i; J! O7 J& B6 a tag_t mirror_feat;
6 z L r2 `) ?0 B- ^6 {$ V+ P/ m8 ]/ q errorCode = UF_initialize();
8 |% ]1 x) Y. {& n if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);: @9 T" Q1 L- Q3 W$ p$ ]8 ~6 i6 Z
- b f5 X; z! Y; W) j/ g
errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);3 `/ `: X& @7 `2 j0 p
if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);
0 k% {: P& R' Z; K. [" A$ w; D+ e // AIW - End
. v% b8 W* }# I* [& \9 h9 ` }
8 S3 c2 W: ^( ]% ^$ o a0 M caTCh(exception& ex)
1 P5 \. T4 r# ] a {: S' m2 Y. L7 \% ^7 W
//---- Enter your exception handling code here -----
, r+ f, A3 `9 l+ F( t7 ^. ?7 U errorCode = 1;
2 _! B' g; ~ ^! _ IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox: ialogTypeError, ex.what());
; ?1 U$ V# }+ {4 Y: r4 H }2 f; d k! G- C" I6 @: h: d
return errorCode;, L/ F! L1 Z2 z/ S0 v
}[/mw_shl_code]: s; `6 d# ?( h3 {+ [
|
|