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

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

[复制链接]

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

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

admin 楼主

2018-2-10 13:38:12

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

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

x

! Q. y4 S6 N: n+ t/ C0 N9 J% p0 o: ~- P5 h
二次开发源码分享: 镜像体
9 X, y, V2 Q6 s5 B
/ c: j( t5 p9 ]: R[mw_shl_code=cpp,true]int IR9027488::apply_cb()
% e. _! M5 `4 a{8 a8 |) E+ t* i8 e5 u
    int errorCode = 0;
& I+ C) E9 `9 o1 _6 Z% l# [    try
1 j% N; i, f- ?+ l0 }8 U1 J8 c    {
/ I& w+ f# U! N8 B, V& |        // AIW - Begin
3 {, d) }  {  {* v, T% {        tag_t body = selection0->GetSelectedObjects()[0]->Tag();0 k- _' ^- u5 V2 f/ R# U2 d* F1 c
        Plane *thePlane = dynamic_cast<lane*>(plane0->GetSelectedObjects()[0]);
8 d5 n& y# O6 H) c1 a' U7 Y7 L# p$ T% B. B9 y3 z
        NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);# A2 ~. v5 G* @2 ?# R
        NXOpen::Features:atumPlaneBuilder *datumPlaneBuilder1;8 W4 B8 b8 b3 @
        datumPlaneBuilder1 = theSession->arts()->Work()->Features()->CreateDatumPlaneBuilder(nullNXOpen_Features_Feature);
; ?! r) i/ I, Z, Q+ a% U. B
2 \$ Y4 Z5 o4 D- A9 }4 z: [        NXOpen:lane *plane1;
' Z6 [) R7 ?; @" S5 H: ]        plane1 = datumPlaneBuilder1->GetPlane();
& P: K/ w9 w9 c+ A
( V* T' K1 @, `- A        plane1->SynchronizeToPlane(thePlane);  // this is new in NX11.0.1, P' s: ?2 E& c# j& `
        plane1->Evaluate();2 G) e4 r* V0 C3 C0 J  V. [0 ]4 L

, s# q9 M1 W5 t8 I* N5 \7 R9 G        NXOpen::Features::Feature *feature1;
5 L, s+ F- `5 a; b        feature1 = datumPlaneBuilder1->CommitFeature();
( {/ \( S- `* |: ?( E
2 @9 P3 d% t! T3 f" F& ?        NXOpen::Features:atumPlaneFeature *datumPlaneFeature1(dynamic_cast<NXOpen::Features:atumPlaneFeature *>(feature1));! |; ]( F; ?: G+ _% u) c: U# Q
        NXOpen:atumPlane *datumPlane1;
  I6 X; Q3 }5 w        datumPlane1 = datumPlaneFeature1->DatumPlane();; X3 ~- y/ D6 B. z

+ J, r( D6 ?+ W# t        tag_t mirror_feat;; K% [- B2 p  i! T
        errorCode = UF_initialize();
5 k( s& ~' c; ~9 d( U/ i        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);
, s$ W4 t" I$ n' V5 b, K/ M0 v( g: C& k0 F
        errorCode = UF_MODL_create_mirror_body(body, datumPlane1->Tag(), &mirror_feat);
, `; ^2 G. V! J* ?6 X        if (errorCode != 0) throw NXOpen::NXException::Create(errorCode);! S3 n5 U" z; D1 M1 m
        // AIW - End
: Y( K; A8 r( O    }, a% @  q+ ]1 v$ ?4 q! `1 }
    caTCh(exception& ex)
4 _) E4 ~) z9 f& O: }7 q    {+ j+ ^, a, _9 Z# c
        //---- Enter your exception handling code here -----
4 z2 H* |, ?; W        errorCode = 1;9 h2 C* Z& a; s5 c# B. j
        IR9027488::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());8 n, Z( Y  {6 {9 \) \  p
    }/ Z8 u- C. G( {$ w9 z- j0 x- Y& [
    return errorCode;
2 v- B/ |9 E+ A$ Q" t- d}[/mw_shl_code]* K% k; M) |( Y/ X0 n" V) M% j: g- y) [
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复

使用道具 举报

全部回复1

popc 发表于 2018-2-11 15:40:42

popc 沙发

2018-2-11 15:40:42

dm.jpg er.jpg shu1.jpg 1 G+ e( N1 v9 Z6 J) K& O, u
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了