PLM之家PLMHome-工业软件践行者

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

[复制链接]

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

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

admin 楼主

2014-3-18 17:03:04

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

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

x
0 d5 Y) J: z# s. c2 {5 ]; b9 [
% z! U, ~0 t! N! B- J. O

  D2 U8 V0 i: Z) UCreate a New Feature 创建NXfeature的标准过程% x& y1 K1 P0 S- s: c3 p  I) g1 E
1.Create an instance of the builder object for the desired feature type providing a null object as input. % V4 y. t3 {8 x( Y
创建一个builder实例,null作为输入; l1 }; W& d7 I  d/ U
2.Edit the properties of the builder object to set the feature parameters and options. , l1 L+ K# e$ U  ?0 p0 X$ R* X/ p
编辑创建的builder,设置一些参数或者选项5 X7 l2 o, O4 s2 A" o
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.
9 l& V! Q  n+ @6 V$ {! Z4 J使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象0 c. d+ w1 r4 X7 Q2 B" ]1 e! Q
4.Use the Destroy method of the builder object to delete the builder object. 1 w; _$ z2 s9 W3 F% t- }0 k2 u# E
使用destory方法删除builder对象。

' l/ J9 m" W# J( U/ \! o  S* G! Q编辑特征也是同样的操作过程!* e0 b2 E9 c0 c- o+ F1 B' M
* w/ V9 m$ Z7 a) R! g
代码举例:3 U0 D7 U2 s' e' @' W
Session *NXSession = Session::GetSession();
! @0 M. r; Z4 W/ L1 x6 HPart *workPart (NXSession->Parts()->Work());
% P0 W8 @5 ^7 ^2 I1 GFeature *nullFeature (NULL); 6 A8 f7 W/ C8 ?, v% P' m, U
Point3d origin = new Point3d(0.0, 0.0, 0.0);
) {3 N, }: B5 G9 f! b//**************************************************************************
' }, a, P9 {2 t//CREATE BLOCK 创建方块
( s$ N9 v2 c+ p% m+ JBlockFeatureBuilder *newBlock = NULL;, Z+ O/ g8 U$ ^+ I) w
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); 0 n2 B& p& i! Z; a
newBlock->SetOriginAndLengths(origin, "50", "80", "100");
5 k, d9 P! V; K! XFeature *blockFeature = newBlock->CommitFeature(); & z7 s0 d. D6 k9 `
newBlock->Destroy(); # u- X; j; U# q
//**************************************************************************
& y; I4 N; ]6 u& n- R//EDIT BLOCK 编辑方块
8 V! a  V8 {. l, b& h9 e0 sBlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
. j/ \) i, T, n4 koldBlock->SetOriginAndLengths(origin, "100", "20", "50");
! d/ Y" p# w4 v: goldBlock->CommitFeature();
2 y; r$ p* k! IoldBlock->Destroy();
5 i6 [3 y2 i. g: x9 O4 u
- f- ]8 D) H  D0 E) C  e1 V
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了