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

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

[复制链接]

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

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

admin 楼主

2014-3-18 17:03:04

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

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

x

# Q5 B2 c3 R7 F1 T9 w' ~3 d' L5 K$ c; `+ S
# `9 r+ a# F- O
Create a New Feature 创建NXfeature的标准过程
1 X: q3 a4 F2 Z6 q5 ~9 c8 _0 H1.Create an instance of the builder object for the desired feature type providing a null object as input.
$ {9 v+ S3 [" v( G3 b0 y3 f创建一个builder实例,null作为输入
! N, W3 n! W7 n: F2.Edit the properties of the builder object to set the feature parameters and options.
: \3 c6 {/ R/ ^编辑创建的builder,设置一些参数或者选项9 T8 Y2 v9 \8 f8 l7 ^& c; d, |3 ]
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.
$ W8 N# Z0 ?& M5 ?" d' v使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象: i6 ?/ o: ?+ m
4.Use the Destroy method of the builder object to delete the builder object.
- o1 c, b! T7 r使用destory方法删除builder对象。

: m+ i5 r' F% g5 N编辑特征也是同样的操作过程!4 ^) G7 I/ m: u+ \, {

/ h* T. C) e5 ~6 {+ n代码举例:
. e& m2 n8 j8 p5 c. O4 T: ~$ YSession *NXSession = Session::GetSession(); / _* R5 j. g$ S; Q" X
Part *workPart (NXSession->Parts()->Work());
5 C" s7 Y$ d+ J0 LFeature *nullFeature (NULL);
6 }1 }# M4 M2 N1 W# |# X! x$ lPoint3d origin = new Point3d(0.0, 0.0, 0.0);
+ R* p4 s2 _# R* }3 ]) U//************************************************************************** # l3 a7 u& B  B& M& S/ v
//CREATE BLOCK 创建方块
5 }  R6 c2 t3 p$ V& }% HBlockFeatureBuilder *newBlock = NULL;
3 I- x0 L# H, t& v, pnewBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); . ~- d6 J9 t# U6 g: c3 c
newBlock->SetOriginAndLengths(origin, "50", "80", "100");
% U, A, y; K3 Q. ~, J4 G1 N! {Feature *blockFeature = newBlock->CommitFeature(); ) E9 M7 P. F6 v
newBlock->Destroy();
1 h) C3 [) P! U% X7 z1 i//**************************************************************************
7 W% d- M( E& v, S( P& T7 h//EDIT BLOCK 编辑方块$ l5 V! A& h; i9 e5 T
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); ; P( z2 q" M+ q$ o  |: C9 \
oldBlock->SetOriginAndLengths(origin, "100", "20", "50");
; L$ z( ^* a& v2 M" ~6 XoldBlock->CommitFeature();
: g" y0 C% {- RoldBlock->Destroy();

+ r9 ]- B& S2 p& N; t7 h+ t4 A- ]& ?2 y
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了