|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
6 N. k. ?5 f+ }1 b0 b$ g" W5 r. o W8 M9 }
' ~7 J( d* j! Q. k8 G0 _" k0 I" Q
Create a New Feature 创建NXfeature的标准过程
. E1 }# x' | \' Q" b( v1.Create an instance of the builder object for the desired feature type providing a null object as input.
8 W8 R( B; ^( w创建一个builder实例,null作为输入# {+ |* s/ ]- v/ V% u2 Z
2.Edit the properties of the builder object to set the feature parameters and options. {3 O2 A, i' c% K2 j( b$ k/ `9 w
编辑创建的builder,设置一些参数或者选项$ [7 M& [/ Q5 [' G" P& ?7 {* 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. & o- r6 M! v5 e! M& J/ G
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
7 m# z& Q5 M4 `. Y4.Use the Destroy method of the builder object to delete the builder object.
3 M; L3 i- E" C: K. n5 r; b使用destory方法删除builder对象。2 e0 F. ^9 h1 n- b* {1 O: @+ s
编辑特征也是同样的操作过程!. f! L0 W/ ?5 H: w; ]8 \
2 D- @ I3 v- C9 n' j# f4 A- L代码举例:
( m! U# f d4 f: U" [* A) @5 ASession *NXSession = Session::GetSession();
9 s) b5 I# H7 M4 C' h# |# LPart *workPart (NXSession->Parts()->Work()); ( w* f, V8 e- c* `, F) D4 s# b
Feature *nullFeature (NULL);
, K/ d% B3 ]" W R3 H2 ^0 ^7 @Point3d origin = new Point3d(0.0, 0.0, 0.0); 7 ] E( h0 `* N' r
//**************************************************************************
( P' Z2 u7 k) g& H//CREATE BLOCK 创建方块
, F3 |: r6 l$ v- @BlockFeatureBuilder *newBlock = NULL;
& e# [( {1 \% ^7 M4 l; A7 xnewBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature);
0 P8 \2 o# ~, Q" v! |, tnewBlock->SetOriginAndLengths(origin, "50", "80", "100"); ( n. K1 u0 `+ @1 U( e% @
Feature *blockFeature = newBlock->CommitFeature();
* D/ E5 n1 n' F% Z# [6 ]: f) jnewBlock->Destroy(); ; ` x1 z5 K4 t9 D _) ]- |/ z
//************************************************************************** + `" g$ }. j a/ q8 Z, {; }
//EDIT BLOCK 编辑方块
/ z: [" N! |8 `, KBlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); * @# ~# T/ f: E9 x' m! M0 I. q, Z
oldBlock->SetOriginAndLengths(origin, "100", "20", "50");
6 r" e' A$ _6 `9 r# U V" `oldBlock->CommitFeature();
0 T5 j" s7 G) V7 woldBlock->Destroy(); * Z7 v" }8 G5 Q% l9 `
* w) A0 d5 V z7 k0 ?) h |
|