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

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

[复制链接]

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

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

admin 楼主

2014-3-18 17:03:04

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

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

x

- l; z& C6 j; A, X& z. o" s! Y( I8 ^8 ~6 H% q/ Q3 u

: m, `7 N, P& Z8 \4 P+ OCreate a New Feature 创建NXfeature的标准过程4 A$ k5 f% J: z9 Q( D! |  _
1.Create an instance of the builder object for the desired feature type providing a null object as input.
+ m6 y8 f3 a8 l$ l: X8 k创建一个builder实例,null作为输入
5 i* }& }9 u0 E/ \2.Edit the properties of the builder object to set the feature parameters and options. ) |" F, d( n6 U$ @" A& s
编辑创建的builder,设置一些参数或者选项! J5 V& @( ^* M! L- y. T+ g" |
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. ) `& T& D  F9 e$ a& T1 L5 h
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象: q# S1 A- F  r
4.Use the Destroy method of the builder object to delete the builder object. : g4 u' M- F$ z8 g' p4 t; ~
使用destory方法删除builder对象。

; V/ A% t+ G7 m0 r& j编辑特征也是同样的操作过程!
4 U& e% ]+ y! V' i
0 h2 D: n9 H4 K$ V9 S代码举例:  L% [* Y+ \. v- d. |$ c7 b3 O
Session *NXSession = Session::GetSession();
. y1 b- T/ C! y8 Q" g4 g, gPart *workPart (NXSession->Parts()->Work()); - c8 V* v  ?( U5 H, B+ z& X
Feature *nullFeature (NULL);
; U9 y& N: v/ X, U( yPoint3d origin = new Point3d(0.0, 0.0, 0.0); $ Y2 W0 X9 Y8 {- Y
//************************************************************************** + E" |3 I: B- h8 |  ^- e
//CREATE BLOCK 创建方块  d, O3 d0 i& X! O  \. z' x1 _
BlockFeatureBuilder *newBlock = NULL;# i( R0 ]! U# i% ]8 Z$ @
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature);
7 i3 f& M2 v0 F3 {newBlock->SetOriginAndLengths(origin, "50", "80", "100");
: }/ G5 b' G% H6 JFeature *blockFeature = newBlock->CommitFeature();
0 E" ?* d  s, Y& Z0 HnewBlock->Destroy();
; r) }3 ~4 ^& k  ^4 S//**************************************************************************
2 p2 p6 }3 X3 h. T//EDIT BLOCK 编辑方块
$ V1 O( v! G2 P6 f' B, sBlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
5 v! t& ^) o: EoldBlock->SetOriginAndLengths(origin, "100", "20", "50");
- ^2 M; A. X: G  C" R6 W* JoldBlock->CommitFeature();
/ [$ a, I" }! uoldBlock->Destroy();
8 k$ ~! H, B7 ~$ o9 j* O

2 g, v% t, X3 m, t9 T
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了