|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
+ `( |2 b6 X* {$ [
/ t" g/ B! z% C( D
1 X7 C2 O, K1 h7 ?0 N( y8 zCreate a New Feature 创建NXfeature的标准过程) n& o# H! y s6 V$ Z# J- C
1.Create an instance of the builder object for the desired feature type providing a null object as input.
3 h+ e, Z) k8 T* j创建一个builder实例,null作为输入
v. i& f- ?$ Q* d+ D) I2.Edit the properties of the builder object to set the feature parameters and options.
6 O! b9 q4 ~! Y! e编辑创建的builder,设置一些参数或者选项
- @1 p- S, t8 R( j T+ G* o; e3.Use the Commit method of the builder object to create an instance of the feature. The Commit method will return the new feature object. / h0 x" R7 ~+ ^9 G1 |
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象: ]! A8 u: s9 W+ z0 v# K
4.Use the Destroy method of the builder object to delete the builder object.
6 D3 S9 T0 R; o+ g0 m' `* G使用destory方法删除builder对象。
U1 k: g3 h5 Z编辑特征也是同样的操作过程!
6 J8 f& J5 `+ f0 l" U5 {
. G( V+ t, G3 r D/ j) k代码举例:5 h' r- r& ~+ S, ]7 k
Session *NXSession = Session::GetSession();
& h+ e; c* k' m" cPart *workPart (NXSession->Parts()->Work()); ; j7 x7 G$ g3 J) r/ s
Feature *nullFeature (NULL); - h! D+ e' W6 j4 Y
Point3d origin = new Point3d(0.0, 0.0, 0.0); / w1 s9 w* D- N
//************************************************************************** ! T, }* B' o& C( f! L: ^ j0 w
//CREATE BLOCK 创建方块
. g t' h! R$ r2 w7 Z& m/ P5 nBlockFeatureBuilder *newBlock = NULL;
8 [6 Z7 n* Z- y- |newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); * u8 h! k( T4 H1 i
newBlock->SetOriginAndLengths(origin, "50", "80", "100"); 5 S/ J B' [% v9 @/ j
Feature *blockFeature = newBlock->CommitFeature(); ' ?0 |1 E, W0 e2 i1 v
newBlock->Destroy();
1 ^. m( j' d: v b//**************************************************************************
" n' p0 y. Y+ w- ]4 Q7 n: R//EDIT BLOCK 编辑方块' K/ s% f5 `2 }% w: z' D7 E- U) a$ b
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
, v$ Y, j7 T! z- G5 loldBlock->SetOriginAndLengths(origin, "100", "20", "50"); & F# g' R3 N% {, `; s
oldBlock->CommitFeature(); * g, P" K5 y! O5 `9 X, A* \
oldBlock->Destroy(); - ^/ I" r$ L1 E0 A
9 _( L, y% c9 Z( X/ x3 E- I2 s( [
|
|