|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
. G2 V$ B8 ?- m& P# |7 T0 h
2 R: u4 n+ J+ d5 a4 P& l
3 V- H/ o1 x! Z% D6 D) oCreate a New Feature 创建NXfeature的标准过程8 B# K; x5 x T, M( q% ?
1.Create an instance of the builder object for the desired feature type providing a null object as input. 7 W% A$ t: k& T' r, \
创建一个builder实例,null作为输入
6 p. |2 t H$ F- j4 a2.Edit the properties of the builder object to set the feature parameters and options.
( p$ Z" b9 @' t3 Z1 T7 h; H编辑创建的builder,设置一些参数或者选项
8 F$ r) H( W0 Z! A- ^* v- b/ ?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. 9 V! T7 ^4 Q$ C. S/ P$ Y
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
' H. K* }7 o1 i& T' ]4.Use the Destroy method of the builder object to delete the builder object.
; E$ [5 x6 u( i$ Z( N& C使用destory方法删除builder对象。
- ?% A0 o" `+ k编辑特征也是同样的操作过程!5 @. F8 `# N. y
# f7 n+ U# n# |) K; n6 R
代码举例:
z6 z& T, }$ N9 I) @ kSession *NXSession = Session::GetSession();
B2 x. ?) u6 O' a- G' O' j( L wPart *workPart (NXSession->Parts()->Work());
* c" a- m, ^* ?) U. ?Feature *nullFeature (NULL); 8 g$ k B1 |) Z! T% B) C) _) g
Point3d origin = new Point3d(0.0, 0.0, 0.0);
, O* n# [( l) ?! O+ V//************************************************************************** / P" h* ~8 P8 R( P* ~
//CREATE BLOCK 创建方块
, l# ^) O5 w3 n) ~. e' u* W/ cBlockFeatureBuilder *newBlock = NULL;6 j& Q8 H# _! [- g" P% X+ w
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); ) L( E) A9 Y2 R8 Y
newBlock->SetOriginAndLengths(origin, "50", "80", "100");
3 P: @( h/ q. `) U6 RFeature *blockFeature = newBlock->CommitFeature();
5 d% |/ Z1 u+ cnewBlock->Destroy(); . Q0 q. Z" U0 [ L+ X' X
//**************************************************************************
# p' q2 y8 {) ~//EDIT BLOCK 编辑方块
3 N! v. M6 M3 r5 _$ BBlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
% I2 L3 x' H: J) n KoldBlock->SetOriginAndLengths(origin, "100", "20", "50");
; E; c1 Q' f, }8 L& |1 boldBlock->CommitFeature();
, G1 D! ^5 q& i6 V W, holdBlock->Destroy();
, a" a, ]9 H3 u" t
" ?. E6 ^* r$ c4 B8 E |
|