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

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

[复制链接]

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

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

admin 楼主

2018-2-10 13:38:12

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

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

x
5 G) Y4 G" H6 ^* q7 r
7 c7 h7 C2 k  T/ i( |- x( J) B
二次开发源码分享: 镜像体
  ^0 S5 |- k/ Y4 `( _7 y+ N
/ S  d% {* a& H/ H$ [[mw_shl_code=cpp,true]int IR9027488::apply_cb()
& G" J5 B% x( v3 m2 w" z; h+ P$ E{
* w" e) {" E0 w) W' k    int errorCode = 0;
3 y) F5 q2 |+ V* D+ O    try/ S/ E9 Y/ [; z0 {0 F
    {) j( y% M; L7 }- y
        // AIW - Begin5 w) O8 m9 x3 x! y3 L
        tag_t body = selection0->GetSelectedObjects()[0]->Tag();+ h) k% c0 |/ K3 \5 a4 E& }
        Plane *thePlane = dynamic_cast<lane*>(plane0->GetSelectedObjects()[0]);
% {. }3 O$ L! D- f+ R
8 G1 ~) Z+ x) W5 p, G2 Z        NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);# w4 G# k+ F, N% H5 v- T
        NXOpen::Features:atumPlaneBuilder *datumPlaneBuilder1;1 Y. f7 q( o6 I2 s8 e
        datumPlaneBuilder1 = theSession->arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);
' k+ l% A" ~: r# b( G! X5 y, M9 a  q: c8 g7 M8 Y" f- |
        NXOpen:lane *plane1;- T9 J4 M# q8 z3 C" J7 e
        plane1 = datumPlaneBuilder1->GetPlane();
) h9 a+ n( Y& d4 S6 e/ f3 v! e2 ~9 K6 f8 [
        plane1->SynchronizeToPlane(thePlane);  // this is new in NX11.0.1+ K2 x% I6 H* p" M: [0 G
        plane1->Evaluate();+ n/ s7 |# J: U
* w- k7 b) S$ ?+ O+ e# {3 M% T
        NXOpen::Features::Feature *feature1;
1 a# l' P' F" H9 ~% o, z# B" `2 m        feature1 = datumPlaneBuilder1->CommitFeature();
" f/ }9 B$ a) x. |1 J6 \4 I( j( W4 q% }8 F
        NXOpen::Features:atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features:atumPlaneFeature *>(feature1));
3 }: J+ P6 S2 t$ s! I' j- j+ A        NXOpen:atumPlane *datumPlane1;- _6 k; g6 u/ |3 d$ w5 {
        datumPlane1 = datumPlaneFeature1->DatumPlane();+ Q+ Y) f1 n# ~* M

3 D7 V+ ~5 _" M4 K        tag_t mirror_feat;
  k: D8 b7 z) d# w        errorCode = UF_initialize();; ?9 W" P5 q2 y' f! _% q. c
        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);( [  Z2 q* F  }& k) ~

: v. ~5 q/ U/ R- z        errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);+ B0 p+ s7 ^1 {
        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);) q, T# @% E# {% ]
        // AIW - End
$ _' w( L& U0 C$ I" g* d8 b) r    }+ R; p6 r1 ]2 [. z, g( l0 \
    caTCh(exception& ex)
! B8 {& h! k3 I, V# H    {
: m# B- M: M# X2 u2 b        //---- Enter your exception handling code here -----7 M' E, R9 f- j: ^5 B
        errorCode = 1;  H; ^+ U% E$ `6 m- D
        IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());+ }4 D4 I  p1 x
    }! a9 u0 q: e; R% m6 B
    return errorCode;4 k5 T, M1 @  Z( o0 q: U
}[/mw_shl_code]
' j! \) F6 W# g: i$ K" A* T& _
上海点团信息科技有限公司,承接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
0 F2 e( w6 a  }+ M: S
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了