PLM之家PLMHome-工业软件与AI结合践行者

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

[复制链接]

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

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

admin 楼主

2014-3-18 17:03:04

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

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

x

/ ]- j; r7 O0 ^  D% Y
8 H5 p- D" g$ m

, }5 ]2 |& Q2 \! ]& OCreate a New Feature 创建NXfeature的标准过程
& z2 a* x) ^  A  B1.Create an instance of the builder object for the desired feature type providing a null object as input.
: o! e# H( Q- H5 t创建一个builder实例,null作为输入
7 x7 `% Q6 F7 m4 I" V  w5 H" x+ P2.Edit the properties of the builder object to set the feature parameters and options.
' D' |7 K7 W  g4 J6 n: p编辑创建的builder,设置一些参数或者选项- s: i+ S0 G5 ^' T
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.
; f0 z! f: e) n0 d3 f2 X$ [使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
9 O7 r" x; ~0 t! d1 D- T0 [8 g" I: m4.Use the Destroy method of the builder object to delete the builder object.
. A4 A$ m. d( _/ y) o使用destory方法删除builder对象。
: Z1 v$ a/ o6 B$ W
编辑特征也是同样的操作过程!- n4 j4 {2 u2 G" r; h' I4 K

2 b4 n/ D4 k  y. @2 g# W4 b代码举例:
; x& K( M& @$ [* pSession *NXSession = Session::GetSession();
# _- d8 `, {6 [7 t* WPart *workPart (NXSession->Parts()->Work()); 7 s! i( g  v3 A( z+ I1 G
Feature *nullFeature (NULL);
: @& I1 @8 m6 T( k. SPoint3d origin = new Point3d(0.0, 0.0, 0.0);
6 B7 q; ^9 V  ?3 D9 Y3 Y//************************************************************************** 2 C! y9 S0 h. r( c7 o0 ]
//CREATE BLOCK 创建方块6 G( X, p1 J7 r6 M) x
BlockFeatureBuilder *newBlock = NULL;
% m  g/ i" t9 O  a8 \' o& DnewBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature);
% `) N+ N8 f# P2 jnewBlock->SetOriginAndLengths(origin, "50", "80", "100");   t$ |$ E' F; `# J# z
Feature *blockFeature = newBlock->CommitFeature();
4 A' p. w) L% v) G+ Q; y! a- o& dnewBlock->Destroy();
! @6 ?* M1 ]# G& Q$ P* y/ \4 O//************************************************************************** ; d) s6 s2 F* K
//EDIT BLOCK 编辑方块! j. _# W$ U+ P+ ~$ G! z& q
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); ' h# G+ U7 d4 i. \0 o* B
oldBlock->SetOriginAndLengths(origin, "100", "20", "50"); " c7 ^1 W+ v8 _# Q+ M
oldBlock->CommitFeature();
" C& {' O" E- l2 ]6 r( Q; yoldBlock->Destroy();
% }1 w: y" f+ u5 k

) y; c9 T( G) e+ u1 N$ J% n
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了