|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
4 R8 i6 Q8 o; c' I6 W$ }3 r
2 z8 z& G p% x: e# s# v二次开发源码分享: 镜像体
( B0 b8 D7 A( ?" D C
/ w9 Z6 y# u! {4 g% c' j[mw_shl_code=cpp,true]int IR9027488::apply_cb()1 B" v" {- @" D5 h: T7 G5 [
{+ G) F% H& W! D
int errorCode = 0;6 n v' H7 [$ w F* Q* v6 f! x! D) |/ G
try7 F' r9 [. z5 q- V* ?
{
0 h& P7 m; s7 w! A& F // AIW - Begin" m6 G5 \0 B3 L5 `* v
tag_t body = selection0->GetSelectedObjects()[0]->Tag();0 ~* Q' R2 v( N: Q
Plane *thePlane = dynamic_cast<lane*>(plane0->GetSelectedObjects()[0]);
: {% t. J8 i0 |1 t0 E, m- D
% l7 E8 t2 r2 U& G: Y0 V s% h. [1 H( i. x NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);
4 [8 L ?" N8 _3 i/ h# W) B6 o NXOpen::Features:atumPlaneBuilder *datumPlaneBuilder1;2 G" U$ Y$ q4 s7 s _
datumPlaneBuilder1 = theSession->arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);% K* w4 }6 B/ @- y$ h: l
- V! F6 n7 F9 {4 C# Y
NXOpen:lane *plane1;3 _( c9 H( T" v3 `. w! U& o
plane1 = datumPlaneBuilder1->GetPlane();
. P0 [( [8 d: i# I' W" V, @. y0 p1 D
plane1->SynchronizeToPlane(thePlane); // this is new in NX11.0.1
; [/ \, c9 u- ^( s plane1->Evaluate();
+ b0 X6 ]& w+ \
( Q- `1 g5 {$ E2 `; y0 l( m NXOpen::Features::Feature *feature1;
0 Y/ \! o1 Y2 `* ?: B feature1 = datumPlaneBuilder1->CommitFeature();
N: l+ Z' Y% L# }8 x5 r: \! q# h. i2 i6 Q/ d" j/ L9 Y
NXOpen::Features:atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features:atumPlaneFeature *>(feature1));" Y7 J! d7 a) H( T; H ] B
NXOpen:atumPlane *datumPlane1;' M) p( ?6 N5 q" d7 e; v
datumPlane1 = datumPlaneFeature1->DatumPlane();
8 C! Z ]# @4 ], f
. [9 L# H0 p+ g/ T# w& s tag_t mirror_feat;8 N$ ]/ ~ I M, |
errorCode = UF_initialize();
- _$ R4 K/ G+ I% p, z if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);, ]$ y, g, C' T0 Y
" }- q& d4 w- p# s8 { n* ~2 W errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);
( G* J, a8 s% L C: b* d if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);% S: ~2 S; ?% F8 c
// AIW - End
8 ^) }' V7 N% z: A2 Z }
v5 j B: Z* A( k& j1 b4 h caTCh(exception& ex)/ ~" l s9 X& A2 G1 @# }
{
6 J7 `9 k+ Y( n3 j: u! W //---- Enter your exception handling code here -----2 A; }1 }3 f% p: U+ h" n
errorCode = 1;1 U1 \' B( ?. ~; H B
IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());: _. s; s# \ ~' W8 p/ K4 H
}
6 E/ L; f, a: Q7 I9 R! w# Z return errorCode;, B- H8 k, k$ B0 i7 c
}[/mw_shl_code]
9 s5 X6 w# x- Z |
|