|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
' [2 h5 N- l- r. V% a$ t5 X4 m+ m
! `3 q7 {/ i6 J3 u9 ]) w8 d0 n5 V& i
Create a New Feature 创建NXfeature的标准过程
0 e$ p; E# f3 Y2 e1 N: e1.Create an instance of the builder object for the desired feature type providing a null object as input.
$ [1 g H& }6 k( c' p7 Y( W创建一个builder实例,null作为输入" r( S1 x; ^$ X- r& L5 P
2.Edit the properties of the builder object to set the feature parameters and options. ) W2 b. y* v, r+ ]8 P
编辑创建的builder,设置一些参数或者选项
, F7 h+ E) q W8 [! V; R: @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.
' m) F" p' C* j( I使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象4 G" A* }" K: F j; D
4.Use the Destroy method of the builder object to delete the builder object.
/ u; W t$ ~: ]( J9 Q3 R使用destory方法删除builder对象。
. H9 x9 C* K$ l7 ?+ u& `编辑特征也是同样的操作过程!& ^( d$ v( D( @& B( ^$ C
2 J+ S2 y! P8 U, W$ l5 |/ T% k) I代码举例:, |, H5 x7 G6 G$ [! }& b
Session *NXSession = Session::GetSession();
/ J+ n- \" J# Z" w" j" rPart *workPart (NXSession->Parts()->Work());
3 S; @3 c7 l" k7 [( @% y" ^& w d. H1 IFeature *nullFeature (NULL);
0 x5 V0 h$ `2 W5 BPoint3d origin = new Point3d(0.0, 0.0, 0.0);
$ |! W( e* A: Q: l/ m* k, j# [$ m//**************************************************************************
' R. r) P8 p. y; b//CREATE BLOCK 创建方块
' X) Y9 I: t; g* }6 VBlockFeatureBuilder *newBlock = NULL;
3 c4 m( e4 x3 n, C% b+ D) UnewBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature);
7 f: M* [* x1 n- q' {4 _2 T. x4 U9 CnewBlock->SetOriginAndLengths(origin, "50", "80", "100"); - d) u3 @8 f6 O4 r: ^: \
Feature *blockFeature = newBlock->CommitFeature();
0 E- m: z. I( ~, N/ Z. h1 A/ F9 gnewBlock->Destroy();
1 q D1 `( x6 S3 U- L" t1 q//**************************************************************************
" J6 W- O5 b0 T//EDIT BLOCK 编辑方块' f: U8 R, f( r2 r3 `, b. P; p
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); 4 y% Z, h) K1 ^7 \) {" [- x# E+ S
oldBlock->SetOriginAndLengths(origin, "100", "20", "50");
8 c5 n* F5 o; d9 W* F2 coldBlock->CommitFeature();
4 I' b1 B* r# K; q T/ f. \ woldBlock->Destroy();
5 v8 P* m% m" e+ W/ D6 p0 F! a2 d
|
|