|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
' s$ y8 B* O+ [/ h- d2 P
7 b3 V4 _- m4 x H
* g( M8 ~1 I8 k4 N @Create a New Feature 创建NXfeature的标准过程- v7 I/ M0 W4 g7 z( ]5 C
1.Create an instance of the builder object for the desired feature type providing a null object as input.
. L! N' B5 k) E8 N6 ] {: N, j" [创建一个builder实例,null作为输入& b2 H! Q5 c" z' `
2.Edit the properties of the builder object to set the feature parameters and options. # j9 v# W( l, W$ @
编辑创建的builder,设置一些参数或者选项
5 J2 I$ }$ r* \, u- O9 f, Z3.Use the Commit method of the builder object to create an instance of the feature. The Commit method will return the new feature object. s8 _2 ^7 ?- g# G
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
1 y" A9 I2 H9 B3 o# R c4.Use the Destroy method of the builder object to delete the builder object. 7 r R7 {# b0 n% ^' s' p+ V
使用destory方法删除builder对象。
. ?+ G$ l6 ^0 F8 {0 L! r编辑特征也是同样的操作过程!
9 f* [1 w$ c! O) {4 C+ Q' N. E# }0 H1 N0 Y# u8 Y
代码举例:
# Z/ O/ @. g) f0 |/ QSession *NXSession = Session::GetSession();
, v% s; A1 n9 H. e. FPart *workPart (NXSession->Parts()->Work());
" [: z. T8 j1 L4 r! o( r* q( x& l% PFeature *nullFeature (NULL);
6 d: Z; s& Z8 MPoint3d origin = new Point3d(0.0, 0.0, 0.0); 4 V$ [5 W. b% w5 E- S
//************************************************************************** : L! W7 R ]7 [' J$ p
//CREATE BLOCK 创建方块
9 [% v+ o Z2 [" J* @ s qBlockFeatureBuilder *newBlock = NULL;3 f. ^ q n2 [& S( n. j& Y2 r
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); 1 E2 y0 X$ Y* |* j& A3 O0 q
newBlock->SetOriginAndLengths(origin, "50", "80", "100");
# i0 X, a9 ]. P2 \, b; {+ i% kFeature *blockFeature = newBlock->CommitFeature();
# @& |$ d) `- \" x( l/ ]newBlock->Destroy(); 7 I( Y, Z) [. Y o" ~8 `
//************************************************************************** & x1 c. z1 g, b- |* L r
//EDIT BLOCK 编辑方块
( K+ k0 E- n9 G$ I) j! ~BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); {5 v+ ?" X: V; ^; Q3 U4 m; ?
oldBlock->SetOriginAndLengths(origin, "100", "20", "50"); ! y5 Y; f, P, u" h
oldBlock->CommitFeature();
6 p; l# x0 z+ @- _. |- w( woldBlock->Destroy(); 3 @0 c' s# K1 g l! J
2 e2 _9 g( y% s( z C
|
|