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

[二次开发源码] 使用NXOpen C++创建和编辑特征的详细过程,一看就会!

[复制链接]

2014-3-18 17:03:04 3224 0

admin 发表于 2014-3-18 17:03:04 |阅读模式

admin 楼主

2014-3-18 17:03:04

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

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

x

! `4 \5 }( j0 C" z% Q' ~- R9 v$ W- x+ H) t
* E  ^# y* k, p9 I# [) D7 L
Create a New Feature 创建NXfeature的标准过程
, ]3 F& j+ S5 w0 @3 P+ s, _+ {1.Create an instance of the builder object for the desired feature type providing a null object as input.
) h% e8 k8 U8 q3 X% w1 k3 \: B3 T创建一个builder实例,null作为输入
) L6 J; \6 L# V' }  q. |2.Edit the properties of the builder object to set the feature parameters and options.   `0 h6 K0 v' ]9 g; x; v9 Z
编辑创建的builder,设置一些参数或者选项/ W0 z; a- I! O4 M
3.Use the Commit method of the builder object to create an instance of the feature.  The Commit method will return the new feature object.
( }2 d, c: y# v! o8 m使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
2 A: W5 O1 J: b! F8 F5 ?' `+ X3 y4.Use the Destroy method of the builder object to delete the builder object. % ~- r+ I0 T8 O
使用destory方法删除builder对象。

4 Z- q" I6 c5 D- m编辑特征也是同样的操作过程!
( r, o3 t$ |5 S2 D& C8 f8 v* x3 [# i! N& y/ t, c( n
代码举例:
4 z4 q+ X( A$ L; f6 }Session *NXSession = Session::GetSession();
6 n4 J# |/ \) t$ L2 X; B6 N1 }Part *workPart (NXSession->Parts()->Work());
9 N6 o# N2 i! c8 qFeature *nullFeature (NULL);
- x! u* _4 J. l+ BPoint3d origin = new Point3d(0.0, 0.0, 0.0);
" S$ p1 F/ I8 F& _4 _//**************************************************************************
1 l- H2 p1 E6 Q- h' p/ _, h//CREATE BLOCK 创建方块
/ g4 W( }# n9 h" t  W( SBlockFeatureBuilder *newBlock = NULL;
% Y$ q. S5 R. x7 ~8 q, U" wnewBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); % c7 s1 p* k, w: L1 g
newBlock->SetOriginAndLengths(origin, "50", "80", "100");
4 }5 E' K9 o8 L6 v" K) a: n6 mFeature *blockFeature = newBlock->CommitFeature();
; J# O. I. ~) M3 \; ynewBlock->Destroy(); - h2 ^' z* F3 v9 A
//************************************************************************** ( z" j; @9 T  X2 i) z
//EDIT BLOCK 编辑方块# y) Q6 B' C# M  J5 m
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
" x5 \) t1 f1 w4 ?' }3 A- p" j3 moldBlock->SetOriginAndLengths(origin, "100", "20", "50");
: p; V& m, @; ?+ n% c: ooldBlock->CommitFeature();
9 a% L0 f; j7 [' GoldBlock->Destroy();

# Y; G$ A$ \6 z7 w' H5 h
. E' w0 A  G7 E7 I' q
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了