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

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

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

积分
82168
QQ
发表于 2014-3-18 17:03:04 | 显示全部楼层 |阅读模式

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

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

x

$ K" Y4 S( ~9 X2 v5 l$ n9 F' V/ ]. f: p1 `& [! j0 n+ e) A

' J0 y: T- y% h) ]Create a New Feature 创建NXfeature的标准过程2 R; {- w9 I6 X6 ~3 w
1.Create an instance of the builder object for the desired feature type providing a null object as input.
* d6 A# ~% m& s创建一个builder实例,null作为输入
3 F4 d6 w$ R* x% O" l& q1 d2.Edit the properties of the builder object to set the feature parameters and options. 2 O3 _. z( s1 a3 s' e' B5 A% o
编辑创建的builder,设置一些参数或者选项% S9 I4 }6 V, D# v
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.
% S: \1 c" @* q使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象+ f, E0 ]4 m% D# K
4.Use the Destroy method of the builder object to delete the builder object.
1 S" R3 E7 |/ h" \* T2 Z使用destory方法删除builder对象。

: ~* y% R5 s. T* U0 a编辑特征也是同样的操作过程!
, h% ^% b/ Q5 V! W6 r$ `$ Z  |# ?7 s+ L) L- j* s2 z6 q5 C
代码举例:- r. {% o. e: K' B
Session *NXSession = Session::GetSession(); & ~0 Q' y* c7 b1 L4 R& b$ \! H' E
Part *workPart (NXSession->Parts()->Work());
! @0 O/ s: ?" L7 OFeature *nullFeature (NULL); 8 [8 h( w5 e. l3 |; g4 n
Point3d origin = new Point3d(0.0, 0.0, 0.0); 0 B, v8 X0 r$ h/ o! r4 ~& E
//**************************************************************************
- r# v6 c& X4 j$ l9 Q8 X//CREATE BLOCK 创建方块
9 K& Q( f& J7 D% Q& F) b) j. jBlockFeatureBuilder *newBlock = NULL;! ?% X$ z$ j, a" ^
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); " k  n2 S6 l+ Y# a1 h5 I
newBlock->SetOriginAndLengths(origin, "50", "80", "100"); ) s4 Y: e$ ~9 u3 |4 \/ s' B
Feature *blockFeature = newBlock->CommitFeature(); " f% U, X2 M  [8 B2 f
newBlock->Destroy();
( u4 S' c+ U2 d: [//**************************************************************************
" D0 O4 l. _! ^2 N' F//EDIT BLOCK 编辑方块
8 p# l9 T8 Z& TBlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);   M) S: k! U# H( X/ U( z* f
oldBlock->SetOriginAndLengths(origin, "100", "20", "50"); , f  i" |7 X  w0 |  T& K
oldBlock->CommitFeature(); / [/ _+ D! }8 y% K
oldBlock->Destroy();

- y% P; C# A7 O
& V( E6 ~( Z  w) I8 z
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了