PLM之家PLMHome-工业软件与AI结合践行者

[二次开发源码] 二次开发源码分享: 镜像体

[复制链接]

2018-2-11 15:40:42 2388 1

admin 发表于 2018-2-10 13:38:12 |阅读模式

admin 楼主

2018-2-10 13:38:12

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x
0 p, `" ^' @4 Q) h4 [5 S. q" d1 w
% f; r2 ~  |" y, `
二次开发源码分享: 镜像体
' L$ ]6 z9 t1 M" p. [2 z( X+ _. A3 o- _
[mw_shl_code=cpp,true]int IR9027488::apply_cb()8 M6 U8 _! K5 C7 e
{7 l& L8 O6 J" F1 c
    int errorCode = 0;
! c1 P* @9 M8 g5 w& |5 u2 G    try+ X4 G& _* z, h3 b& g
    {7 P- W& Z$ e) e) h; F
        // AIW - Begin
; b0 g4 b4 y5 p2 N& L        tag_t body = selection0->GetSelectedObjects()[0]->Tag();
1 j( d% i1 ^9 x) l0 X; H        Plane *thePlane = dynamic_cast<lane*>(plane0->GetSelectedObjects()[0]);
* H( O9 z/ B- z4 e3 `$ Q( V" k0 E* H2 ?/ O6 V
        NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);
' @/ s9 s* J2 _& X' k        NXOpen::Features:atumPlaneBuilder *datumPlaneBuilder1;2 Z; \8 A2 R- w. G5 W) H6 L  g) `
        datumPlaneBuilder1 = theSession->arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);7 z! n, P7 F& r7 W7 ]
, p' J( g2 r, |# R# C0 E; o
        NXOpen:lane *plane1;& R# I  f* \9 E' ]7 X2 [
        plane1 = datumPlaneBuilder1->GetPlane();& y+ f9 w6 P0 ]4 I- i6 n
& A: T# b: g4 b/ s0 m
        plane1->SynchronizeToPlane(thePlane);  // this is new in NX11.0.1
& R& u0 p6 q# v* C, J) N        plane1->Evaluate();, U& L- {& ^& a3 W
( }  q9 R0 \, N& x4 L" \
        NXOpen::Features::Feature *feature1;8 Y1 J4 \7 _! J
        feature1 = datumPlaneBuilder1->CommitFeature();
- \, Q2 [. t: [% }7 Z- ~- B+ ?; A% Z5 _) O4 p, e
        NXOpen::Features:atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features:atumPlaneFeature *>(feature1));
, o; K+ S. s4 q2 j& X& ], @        NXOpen:atumPlane *datumPlane1;! j8 l& f: K5 n3 B6 e4 A7 x: R8 K; j
        datumPlane1 = datumPlaneFeature1->DatumPlane();% {* H6 e1 ]7 j& ^8 x
% O" }9 Y% w$ X0 D
        tag_t mirror_feat;& f) q# {; e; o8 ?
        errorCode = UF_initialize();
2 |7 t& U" B( N3 N        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);  X1 ?4 ~( S; I- G$ j0 F

( x& l- X2 w% P2 F4 Y0 b6 `        errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);. Y) K4 a$ w, m8 f# q3 q# l
        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);9 Z6 X$ G) U; Z4 V6 h" |( B2 m
        // AIW - End
3 L4 z6 p- {+ i4 a: w& s    }
" {$ h' @5 r6 n+ F( ]* ]    caTCh(exception& ex)
9 d6 ^, ?+ J* f% h6 m+ O) j- p    {3 \# Z( I2 `( |& O
        //---- Enter your exception handling code here -----
0 v& L4 j4 a. h. E9 F. N; |6 [' s( L" u        errorCode = 1;4 E$ x3 V" ~7 r5 T* |% A3 j2 C9 I+ R
        IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());! D: L, Q! a5 Q7 ]4 B$ u
    }
% ]- u- }: l# T0 J5 L9 [    return errorCode;7 ?$ K) f0 P4 b7 h5 j3 m# u
}[/mw_shl_code]0 n3 W( g; g' C1 c) m
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

全部回复1

popc 发表于 2018-2-11 15:40:42

popc 沙发

2018-2-11 15:40:42

dm.jpg er.jpg shu1.jpg : R, V7 x- W! P% a& H  p+ o/ \. K
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复 支持 反对

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了