|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
s' K) K6 ]5 [8 ~& m7 [1 }+ l q& [5 C y# }8 X: u& b: K
7 V9 O2 y$ q' a7 C, b; l% bCreate a New Feature 创建NXfeature的标准过程
6 {* _6 a; {3 L6 M1 D6 m3 D3 Z1.Create an instance of the builder object for the desired feature type providing a null object as input.
' \# B7 C: V! s0 b% i, ^1 H- s创建一个builder实例,null作为输入# p. g$ @$ ~9 r
2.Edit the properties of the builder object to set the feature parameters and options.
+ O" p+ \1 t* a; H编辑创建的builder,设置一些参数或者选项
* F* M9 }. Q! a3.Use the Commit method of the builder object to create an instance of the feature. The Commit method will return the new feature object. 8 N1 u7 U4 ]; M) W3 z9 G5 R
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
4 ?; X. {! n% g4.Use the Destroy method of the builder object to delete the builder object.
3 Z0 v% C0 ?* l* O3 w q8 V使用destory方法删除builder对象。2 w1 w7 ~1 a2 v( }& F
编辑特征也是同样的操作过程!
! A' C0 K: u% `+ q' J
' |2 m& B6 A8 F% T" m1 J0 v代码举例:0 k( l# G, Y* V! g r
Session *NXSession = Session::GetSession();
/ j! U& ]/ o" Q) _2 t/ j9 e' UPart *workPart (NXSession->Parts()->Work());
7 K' J' G8 S2 l* vFeature *nullFeature (NULL);
7 J, x. j7 p" N9 z2 _6 C, G+ JPoint3d origin = new Point3d(0.0, 0.0, 0.0);
8 l$ ~' ^' x# ]+ Y, [) v//************************************************************************** : X/ L! Z ?3 W; ]9 @: y# E
//CREATE BLOCK 创建方块
( V3 @9 `+ k3 h$ aBlockFeatureBuilder *newBlock = NULL;* d/ b' v8 Q8 T
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); 7 o; }9 G8 `2 x7 g7 R
newBlock->SetOriginAndLengths(origin, "50", "80", "100");
+ K. l1 w7 [7 x; [# t0 f+ R5 T1 UFeature *blockFeature = newBlock->CommitFeature();
5 `% c4 S8 K( ^" XnewBlock->Destroy();
3 @, ]" N# H- N5 U2 P$ |& N4 R3 x//**************************************************************************
: p$ B$ _6 y6 X# O D/ P- L! ]9 ^! c# {//EDIT BLOCK 编辑方块! p# i* j- R& h' P
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
3 G5 c9 ^- K( e) n* VoldBlock->SetOriginAndLengths(origin, "100", "20", "50");
8 \ Q+ l5 |5 @6 a/ \" M# y9 aoldBlock->CommitFeature();
! {) w) v- u: b# `oldBlock->Destroy();
- ~' ] g$ U- U) X: k& _- z1 y5 V$ @1 ?1 q# B' b
|
|