查看: 2721|回复: 1

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

[复制链接]

2477

主题

1280

回帖

8万

积分

管理员

PLM之家站长

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

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

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

×

0 l7 g4 t: N; L/ `( v, j" w) n3 ?- [8 Y' ~: j
二次开发源码分享: 镜像体
) s: C- u7 i0 s1 F
/ V& S+ c5 u( R; Z  Q[mw_shl_code=cpp,true]int IR9027488::apply_cb()
# a, D1 B9 r4 t! N* i! d  {( e0 d{2 X/ P( Z' I5 u4 }: \8 n- _
    int errorCode = 0;6 z% l/ \6 G" e$ M4 h
    try
* r, a( _4 Z! W5 Q    {
. O6 U" Z3 h- X3 x5 Z: O        // AIW - Begin
+ b7 r) b3 _6 n8 _1 O6 E        tag_t body = selection0->GetSelectedObjects()[0]->Tag();
' z! W7 j7 h* A$ E        Plane *thePlane = dynamic_cast<lane*>(plane0->GetSelectedObjects()[0]);
0 h. N; R( Q" R8 e" v3 X
" n- K& K; N2 [        NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);
  ?: r6 t8 O8 X0 q1 {8 z( z        NXOpen::Features:atumPlaneBuilder *datumPlaneBuilder1;" q5 O$ @* {2 K( E6 V$ Y
        datumPlaneBuilder1 = theSession->arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);
  v/ }# U. r" Z8 q
' b! x3 B+ e2 f+ L, \9 D        NXOpen:lane *plane1;
7 W1 q/ d- {6 B7 Y        plane1 = datumPlaneBuilder1->GetPlane();
5 e5 J3 E9 ^6 v4 m
4 Z6 l+ f  ~9 @' u2 z0 G( q' {        plane1->SynchronizeToPlane(thePlane);  // this is new in NX11.0.1
. _; P; j. b- F' [7 q3 ~4 n        plane1->Evaluate();
$ a2 h) w; v& ], J/ @9 I7 ]5 Y# l0 j7 c1 a7 N
        NXOpen::Features::Feature *feature1;
# ]! c* ]/ ^2 J- V" A! b, a        feature1 = datumPlaneBuilder1->CommitFeature();% B! Q7 l0 n4 Y

, m8 V& e, f" Q        NXOpen::Features:atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features:atumPlaneFeature *>(feature1));
$ X3 H+ z5 M+ C5 W' f  q. I' O  U        NXOpen:atumPlane *datumPlane1;
2 o# l( y& J6 K1 _; @        datumPlane1 = datumPlaneFeature1->DatumPlane();
# c$ h! d* V8 h: \, Y, w# m4 t- i5 l2 H9 k* I8 b
        tag_t mirror_feat;
% H! a( G0 Q: X! J1 g        errorCode = UF_initialize();
0 C" H& Y- E5 ?$ c* r8 @% ~        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);
; ~- V6 S  w; S& h- K3 }7 U! N4 [4 j' ~. {# _
        errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);
& ?: ^! m* q* a        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);' b" E7 H  b5 q% z2 F7 U
        // AIW - End2 {/ c+ q9 i3 ]5 ?1 |" ?
    }
, L) l0 v7 Y" \% A+ e! ^    caTCh(exception& ex)
" Y. {. t, G/ D2 ?1 }    {. l) p" Z5 J6 ~! j6 Y- ]
        //---- Enter your exception handling code here -----+ x8 b  y5 H" ^0 R$ d) P
        errorCode = 1;# I/ Z- g- v* s
        IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());
9 J" u1 c! g8 r, X: s    }$ s1 b$ U0 }, d6 n+ l. T
    return errorCode;
# x4 ]9 H2 y1 o" T% M5 ?}[/mw_shl_code]& R* |7 F% T8 z
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

0

主题

1

回帖

4

积分

新手上路

积分
4
发表于 2018-2-11 15:40:42 | 显示全部楼层
dm.jpg er.jpg shu1.jpg * g( i$ S& }7 Y7 B; J! ^2 I% s
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复 支持 反对

使用道具 举报

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

本版积分规则

在本版发帖
关注公众号
QQ客服返回顶部