PLM之家PLMHome-工业软件践行者

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

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

积分
82170
QQ
发表于 2018-2-10 13:38:12 | 显示全部楼层 |阅读模式

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

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

x
) q; P9 I( }" l1 l

# g; m! F5 I7 c; I, A/ U二次开发源码分享: 镜像体 - ?0 m$ b6 M' O( ?' g* c! v

, }9 B6 J% c/ r% S4 a0 c; k% S3 d- O[mw_shl_code=cpp,true]int IR9027488::apply_cb()
  O- l# I6 k, I6 J{+ \1 `' b3 M$ U8 R2 w  {
    int errorCode = 0;
! \" O% {) U1 j8 G( J4 o    try
6 g0 D# t4 v% q$ O4 l    {
, h# w" J1 R6 d! H: x        // AIW - Begin
& X4 o% S) B( o- U* |8 P% u        tag_t body = selection0->GetSelectedObjects()[0]->Tag();. O* _$ F0 d8 H* \8 J+ t
        Plane *thePlane = dynamic_cast<lane*>(plane0->GetSelectedObjects()[0]);
  U5 {# q6 k/ }6 @+ c! }! B) H
3 F# s" h) P: h/ E+ T& S, p- \/ G        NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);  B2 K5 l& F0 j( P+ M7 ~6 F" }
        NXOpen::Features:atumPlaneBuilder *datumPlaneBuilder1;
( Q& o' T8 {, {* d: n        datumPlaneBuilder1 = theSession->arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);
2 A* @: i7 K0 g+ S! E# ?) N
! F1 S! H. i) E        NXOpen:lane *plane1;5 y8 R% R) D; Z
        plane1 = datumPlaneBuilder1->GetPlane();
5 k$ i- S3 o& w7 w7 q. q
! T3 Z: q( z2 L( A        plane1->SynchronizeToPlane(thePlane);  // this is new in NX11.0.1
, {" W" H% B% L1 m: c- r3 I2 c1 V        plane1->Evaluate();
/ I1 n1 F& [/ O6 y1 c; l% s
2 u0 H, @4 N4 B" H9 L1 Y        NXOpen::Features::Feature *feature1;
5 ]) m, ?0 N9 x1 d0 k        feature1 = datumPlaneBuilder1->CommitFeature();: e; F- p* W' G* ~7 u

$ |4 L8 R% s$ a: v- `2 J        NXOpen::Features:atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features:atumPlaneFeature *>(feature1));# L0 |% J5 h& V' g, H4 C
        NXOpen:atumPlane *datumPlane1;6 |: e. W% B; Z) H3 O( h
        datumPlane1 = datumPlaneFeature1->DatumPlane();. ]9 k: K: I: V7 Q

% K! J4 J8 @# O        tag_t mirror_feat;3 l& R- E2 ^( C/ p
        errorCode = UF_initialize();
4 F/ O# f9 H5 X; U% e        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);: Z, f+ E+ j9 W2 O/ ^/ w; Z

4 W) J: P: C; E/ g2 f0 B, I; |0 P        errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);3 y- s) j; u+ \2 Z6 b  h
        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);
4 D- O( j7 A" O0 w& ^/ a        // AIW - End
# H. I7 [- J" y8 K    }
8 g& {; g# M& W( g9 C% `6 k    caTCh(exception& ex)& ~  L5 ~' [$ G
    {
$ i# @6 ~8 ?5 p2 f' a. V1 d        //---- Enter your exception handling code here -----0 M; {$ Q( w) ?: {6 D1 o6 Z7 f
        errorCode = 1;" ^2 ]+ c7 T6 |1 K$ U* N9 S& u3 b
        IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());
$ ~$ Y0 y3 d: k7 }* Y' a- c    }
2 \/ s- U* i' ?. f+ Q1 G* }    return errorCode;+ w' v: m, a" P& w+ e
}[/mw_shl_code]
3 n- w3 F& B/ n5 D. l. G# K7 Z5 h
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

全部回复1

0

主题

1

回帖

4

积分

新手上路

积分
4
发表于 2018-2-11 15:40:42 | 显示全部楼层
dm.jpg er.jpg shu1.jpg 0 @( l. b) ]/ _$ P" z
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复 支持 反对

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了