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

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

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

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

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

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

x

, c( O7 C. o$ _0 y* k& s0 F9 ]; ^
9 m6 F6 }" g  Z! q二次开发源码分享: 镜像体
" U9 z, V; S& y' h0 E+ b/ F$ K* ^7 E5 F) F
[mw_shl_code=cpp,true]int IR9027488::apply_cb()' d- t5 k+ D2 Y- m9 x- c
{% C* f; \' }  O: @$ h( y
    int errorCode = 0;- P- G* r9 t% ?9 P- \: Z
    try5 D( T3 |, _  W- z
    {
, z1 o3 {$ n7 N        // AIW - Begin
: O* I  Z) |$ X        tag_t body = selection0->GetSelectedObjects()[0]->Tag();2 `, h( `9 m2 v% w/ `% r
        Plane *thePlane = dynamic_cast<lane*>(plane0->GetSelectedObjects()[0]);
0 Z0 X6 K: j6 i3 l6 E6 w$ t5 j2 k  ^5 m$ c/ h, y
        NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);
" w' I& p" G9 i% r) ~+ {4 t        NXOpen::Features:atumPlaneBuilder *datumPlaneBuilder1;) y8 c- p" d6 a. p
        datumPlaneBuilder1 = theSession->arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);
: s3 p, h5 }4 K. i/ q# z7 u, J" H
4 `8 ~: S3 {3 t        NXOpen:lane *plane1;
+ l" t- Q4 ]) n6 C* u9 N        plane1 = datumPlaneBuilder1->GetPlane();
  Z% b1 G3 x8 F! e9 M! k& N7 {
0 c; [1 o/ T; ?8 ]& ~        plane1->SynchronizeToPlane(thePlane);  // this is new in NX11.0.1
+ \5 H$ p9 N( P+ \" i        plane1->Evaluate();/ }& s  S- d( N5 k$ G) ?& [
. O8 @& s- b5 X5 }5 z
        NXOpen::Features::Feature *feature1;
9 R& n% t+ g+ w, X        feature1 = datumPlaneBuilder1->CommitFeature();: I2 B, V9 y( i( q# ^
3 y- _# G" D: r
        NXOpen::Features:atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features:atumPlaneFeature *>(feature1));
* @6 K7 ?/ ^; h  i2 F2 ?" k5 H        NXOpen:atumPlane *datumPlane1;
4 m" ?7 X& r2 E1 u  p4 X1 B- f! M        datumPlane1 = datumPlaneFeature1->DatumPlane();
( O; Z. v+ S+ a4 I. D8 w, Z4 w5 t( k, H* L3 y6 Z4 _
        tag_t mirror_feat;9 c* o/ f! o+ g# Y: f7 k8 D3 Q& p
        errorCode = UF_initialize();
+ `- v5 W1 E- |' r1 O+ i        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);6 N( J) y" i0 f( p

5 t) P* G6 e% A* v* S2 z# R        errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);# e1 L5 M* h3 H) M8 f; A
        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);
' E# p$ F, U' V        // AIW - End0 H5 T3 v/ L! @4 y
    }, Q1 O- ^7 \8 J, r# h& z
    caTCh(exception& ex)* _$ d, A! L# ^5 k2 Y- \
    {" m( a1 y" J, K8 ]3 @( b0 Z* I
        //---- Enter your exception handling code here -----; k. H' i3 ?! J+ @3 B9 M
        errorCode = 1;
/ h, g2 s. a3 s3 M! T  A9 W( \4 \        IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());
0 N6 C% w: ~6 z1 d6 Z1 N    }, u% I6 b4 e# q
    return errorCode;* E# d$ @! N9 F+ `8 x3 j
}[/mw_shl_code]* @. b5 `2 `* t3 B
上海点团信息科技有限公司,承接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 . \* Y. F* ^* \) G
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了