|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
3 p @" @1 [0 G5 ~& b
* P2 s) _& _, p
: D8 ?1 [6 R0 M5 XCreate a New Feature 创建NXfeature的标准过程
3 I$ Z. k: i/ O" k3 c0 \0 W1.Create an instance of the builder object for the desired feature type providing a null object as input.
9 [1 i# B/ L& i0 X创建一个builder实例,null作为输入- h# l" m, U* U5 p; P; Y
2.Edit the properties of the builder object to set the feature parameters and options. 0 [# R1 G6 S8 w, P
编辑创建的builder,设置一些参数或者选项
W0 K- @$ t& K3.Use the Commit method of the builder object to create an instance of the feature. The Commit method will return the new feature object.
. [6 r I2 G7 D; k2 k使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
6 A2 o- ]' R7 G) m7 H4.Use the Destroy method of the builder object to delete the builder object. ' P* K% `5 K+ }+ o1 U8 ^6 h
使用destory方法删除builder对象。
) D6 I5 A+ p8 ^! ` D编辑特征也是同样的操作过程!
N' x; g1 `5 q& a2 C$ i5 B0 G% |3 Z
: {2 J! S* Z5 n6 T8 J代码举例:7 t$ `5 A) u" m* W* t7 M, D
Session *NXSession = Session::GetSession();
. s; S1 k# e! T1 f+ ?! b' c* \5 k: ^Part *workPart (NXSession->Parts()->Work());
9 S$ v, x: o2 H" I) ~! BFeature *nullFeature (NULL);
1 S, h3 A- z% N' m/ |Point3d origin = new Point3d(0.0, 0.0, 0.0); 1 A9 s2 X% N- J
//************************************************************************** % t G+ z' z' D3 v1 O
//CREATE BLOCK 创建方块 t0 v3 \7 I9 e* c* s
BlockFeatureBuilder *newBlock = NULL;
3 N: ?/ T; w% L$ J X- tnewBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature);
( t3 X/ ?% v- L" p" XnewBlock->SetOriginAndLengths(origin, "50", "80", "100"); - Y$ [3 i( q; x. A
Feature *blockFeature = newBlock->CommitFeature();
" l( v# P+ p% X, S3 m4 QnewBlock->Destroy();
" t: \2 u: m0 f' P, q//************************************************************************** 7 T5 e- ~: I, C
//EDIT BLOCK 编辑方块# d. {" |' Y6 I3 N1 V
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); / f# w2 e9 L* I& a8 {
oldBlock->SetOriginAndLengths(origin, "100", "20", "50");
# b8 u. B }0 K+ A4 ioldBlock->CommitFeature(); 8 C+ i: Q! |; d& w
oldBlock->Destroy();
* ?5 @9 t( k" P" D7 L! n! k2 k* ~% F4 s; G* h
|
|