|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- r' [0 K3 j+ o5 J5 k3 M, W& S1 V- `7 U0 o6 b7 A
. t: e }2 \. h. [* MCreate a New Feature 创建NXfeature的标准过程
( e/ L8 _3 P/ I1 a, e1.Create an instance of the builder object for the desired feature type providing a null object as input.
, Y1 O% n: t* N8 A2 C创建一个builder实例,null作为输入: M$ e5 J% Q& ~8 O' ^5 w
2.Edit the properties of the builder object to set the feature parameters and options. . Q+ @9 ?. q- V* G7 A7 r
编辑创建的builder,设置一些参数或者选项* M' }/ r0 G( c9 m9 A; P
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. ( b- _% l; ?( T* k: q9 M$ b1 T5 s
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象5 V/ I' m' S% A/ M' G; M
4.Use the Destroy method of the builder object to delete the builder object. 0 t+ F4 k. v& w
使用destory方法删除builder对象。9 [5 Q2 ]9 q g
编辑特征也是同样的操作过程!" s q; S8 |" n
: `/ c* B5 _# a7 E
代码举例:
* ?: _2 L1 S" i# ]Session *NXSession = Session::GetSession();
1 `+ A7 v% D; w! t+ gPart *workPart (NXSession->Parts()->Work()); . S' I4 D2 e; H8 Y" A% _' `) u" y
Feature *nullFeature (NULL); 1 l6 ?7 ? E- m @2 n( [8 A
Point3d origin = new Point3d(0.0, 0.0, 0.0); ( Z& Q. w: Y# N, ^& L
//************************************************************************** : e1 n: M# p! N }
//CREATE BLOCK 创建方块( p3 \. q$ l& }: d( m. |0 x8 P
BlockFeatureBuilder *newBlock = NULL;
4 L/ W/ }6 |3 G( ~newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); 8 Z( V6 n' u& Y! ?) j7 k( l
newBlock->SetOriginAndLengths(origin, "50", "80", "100"); $ C3 y4 ~8 g# \& G+ _& z
Feature *blockFeature = newBlock->CommitFeature();
' i1 E( p8 _: J* A: HnewBlock->Destroy();
" k6 ?5 Q) C5 E6 q2 j& |+ e! |7 H, J//**************************************************************************
( E& u* n9 a7 T4 C. d) |6 ^//EDIT BLOCK 编辑方块( m( ]+ m, @/ F5 W3 `
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
: h4 v! m$ `" ^, woldBlock->SetOriginAndLengths(origin, "100", "20", "50"); 2 J8 @& _# H: t2 B. O
oldBlock->CommitFeature(); 5 ^7 j0 r+ C( j9 o9 J
oldBlock->Destroy(); $ {. p" s- T/ S
9 Q; j" X/ Z: o% Q
|
|