PLM之家PLMHome-国产软件践行者

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

[复制链接]

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

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

admin 楼主

2018-2-10 13:38:12

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

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

x
/ B$ b0 C; ]% R2 ?) T

% n8 Y* i' s$ E. `* F3 A二次开发源码分享: 镜像体
% ]+ S' G  Q' Q1 o8 m: P! e3 X: I% t* N4 f: u, U- ^
[mw_shl_code=cpp,true]int IR9027488::apply_cb()
! _" ?5 N1 `7 P3 ~{
& i; K) j, `% y1 U  {' q1 C1 O    int errorCode = 0;; r" z; N0 u; V% \% _7 u
    try; e$ n; S- Y0 ~5 |' ?5 L5 g4 F- J
    {/ f# R- c5 u7 q# [& j
        // AIW - Begin6 T3 q: }& I1 @
        tag_t body = selection0->GetSelectedObjects()[0]->Tag();: I3 _' y. Z9 M& b
        Plane *thePlane = dynamic_cast<lane*>(plane0->GetSelectedObjects()[0]);' D" d4 Z5 v" l+ r. ]5 W2 d, q

: u* ~. ]# H: s% Q6 s        NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);) M! D& h# n7 ^6 h* u2 C  [
        NXOpen::Features:atumPlaneBuilder *datumPlaneBuilder1;6 t) ?0 C# @1 M" p
        datumPlaneBuilder1 = theSession->arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);( A* k  M, e+ V8 W7 z

; X6 c1 Q  f' F' s        NXOpen:lane *plane1;
( W/ O/ C3 i8 g7 e* M4 ^        plane1 = datumPlaneBuilder1->GetPlane();
5 b5 B; Z6 j6 Z6 g* T
+ U! Q+ }( S! j" |5 v6 i        plane1->SynchronizeToPlane(thePlane);  // this is new in NX11.0.10 c, r, }8 V2 I) M( f. Z
        plane1->Evaluate();
* }" [6 Q) ]0 V- V  {: {. y
/ Z0 d$ ~# j! P$ j$ [: W/ }        NXOpen::Features::Feature *feature1;1 M# B9 Z1 G  C* U
        feature1 = datumPlaneBuilder1->CommitFeature();3 n7 T+ O' g/ [$ K

+ X8 p% @# O3 q! `! P        NXOpen::Features:atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features:atumPlaneFeature *>(feature1));; S% F: _. o- k% ~; q3 y
        NXOpen:atumPlane *datumPlane1;7 Y) D! D5 j) t' X2 |' g) c
        datumPlane1 = datumPlaneFeature1->DatumPlane();2 z" R2 X/ u! x$ O( o8 y

' E% G  L9 ~% t3 L4 S( k        tag_t mirror_feat;
( y3 h. x3 ^6 C3 ^9 o        errorCode = UF_initialize();1 K8 ?9 E# v6 y' `
        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);. \! Y- i( j7 t4 A* q! G3 I4 o! y
3 L' w1 ]$ F* }+ m9 W7 F
        errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);- ~+ ?  C8 _8 L" i/ L2 K6 ?
        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);
. o) k2 K+ a. |( D, a6 @8 ?5 Q8 M        // AIW - End
6 g9 v" k& L+ U/ J    }
3 K" J8 u8 H- {6 C7 d* U9 a    caTCh(exception& ex)# _& w5 {. |9 k2 J
    {
/ a) x4 i3 X- c% j        //---- Enter your exception handling code here -----
6 O9 |  B4 N5 t3 }( I        errorCode = 1;
( p& |" L! l5 U8 j: s8 J! U        IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());+ i; ^- {; H3 Y
    }
4 x, K  V' m8 ~  [2 N3 k( C    return errorCode;7 q  s* K7 a5 U( R
}[/mw_shl_code]
# m0 i# j! c, M- n; |
上海点团信息科技有限公司,承接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 9 o+ m4 \! H7 C6 y$ ^5 @
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了