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

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

[复制链接]

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

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

admin 楼主

2018-2-10 13:38:12

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

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

x

3 o, x6 k7 a  I. J- C
: ?2 h- b% B" ]" N% Z二次开发源码分享: 镜像体 3 N7 d9 A! ]# i8 n* X) ~
9 q. h! G" M# U0 j& P: {
[mw_shl_code=cpp,true]int IR9027488::apply_cb()
: n1 _' O* ^/ |7 I4 @0 @{
. L2 B8 \2 V8 g    int errorCode = 0;
& W% G, p0 ]8 q- |    try
# l8 y' f' O' h    {4 a4 h+ P* j4 i
        // AIW - Begin( S) W/ }% h; T$ F" w0 P1 ~
        tag_t body = selection0->GetSelectedObjects()[0]->Tag();
6 n* J& ^$ S( P+ ^1 [/ W3 O        Plane *thePlane = dynamic_cast<lane*>(plane0->GetSelectedObjects()[0]);& a$ L: p8 b6 V* C" }9 c8 c" z6 j

: G1 f/ F( Y5 f. Q) R9 ?        NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);
' v7 S' R4 I* {& p& Z        NXOpen::Features:atumPlaneBuilder *datumPlaneBuilder1;
4 E4 z, ]8 i: b, T7 \, G, x        datumPlaneBuilder1 = theSession->arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);
) z+ F0 j5 M6 Q+ h& s& @4 G0 H: O2 K& L* Y4 m! l
        NXOpen:lane *plane1;; A' U. V; E% ^! n% u
        plane1 = datumPlaneBuilder1->GetPlane();* K  D. B" H/ b1 J! s
5 \2 {& g% w& {2 b, @
        plane1->SynchronizeToPlane(thePlane);  // this is new in NX11.0.14 {3 @5 j5 I0 q( c. y. }% J: x
        plane1->Evaluate();' Z3 q8 u1 L2 w: \$ Q/ b: t3 f
* f* ]3 T8 a* M
        NXOpen::Features::Feature *feature1;5 Z" K7 ?) `* o  U2 L
        feature1 = datumPlaneBuilder1->CommitFeature();
0 N' E: O+ u. O8 f; B
# i8 v. t2 P1 |" O( O: |; I* u        NXOpen::Features:atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features:atumPlaneFeature *>(feature1));% h; E+ ~" Z  h. A9 H# ]
        NXOpen:atumPlane *datumPlane1;
$ o( l5 r3 o7 {' P- b3 p) L+ d        datumPlane1 = datumPlaneFeature1->DatumPlane();
+ y4 |. L. x) G' {: O
& n; k$ f/ B9 B        tag_t mirror_feat;2 Z6 o; R! U# m2 |
        errorCode = UF_initialize();
% r! B1 d  h# j# p        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);
5 h$ x8 g8 }+ X6 h! {
8 X3 c" I% P, ~+ s! a; [        errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);% {1 S4 C! S) z  ?
        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);
* D, y, P4 h# l" Y        // AIW - End- l6 @4 R! }- c! e$ Y: z
    }
) z% j0 }, q- v3 r. W    caTCh(exception& ex)
$ T& x3 E% X" k4 R( s. j    {% i6 c" Z4 d& J0 q
        //---- Enter your exception handling code here -----
% H% j& @# ~$ G  S        errorCode = 1;
" \. p% f! W% a' _; }6 p7 z6 I        IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());" Q6 s$ W* Y- O$ ^3 `
    }( _$ h& R3 g, ?1 h& ^
    return errorCode;4 Z0 {9 ?; F- m' w5 f! T
}[/mw_shl_code]" K5 h6 E. W+ }4 y; 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 ' R8 z  O. r6 i& F7 I
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了