|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
3 B$ R# g. S% }2 Q: m
L0 I x& @1 E6 a5 h4 H; @
$ `- I" A; v( D+ uCreate a New Feature 创建NXfeature的标准过程
' N6 n& n; `. ~3 v1.Create an instance of the builder object for the desired feature type providing a null object as input.
: p1 q: i$ D9 O# r) [+ B0 ]! ]创建一个builder实例,null作为输入& @/ u# `% d8 x$ h2 w, \
2.Edit the properties of the builder object to set the feature parameters and options.
; D3 X4 G7 a/ z编辑创建的builder,设置一些参数或者选项
! G( N* S! j, z" E- A3.Use the Commit method of the builder object to create an instance of the feature. The Commit method will return the new feature object.
8 a5 q, S! J9 R2 @使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
' j' O( Z; E" e9 {7 z- L4.Use the Destroy method of the builder object to delete the builder object. ' J: f- Z& R: W* W3 b. d$ Z: S P' }: B# |
使用destory方法删除builder对象。
# g0 H1 _! D; _编辑特征也是同样的操作过程!
& \# t4 ]' t6 e9 a0 r. { L" ?+ w' ]+ I. \
代码举例:: d$ A: F5 `0 Q8 A8 \
Session *NXSession = Session::GetSession();
6 ~5 h! D& H- uPart *workPart (NXSession->Parts()->Work());
6 j% \: F* y( g4 f0 U$ gFeature *nullFeature (NULL);
2 j& b* W: {" \# K) k6 c. {5 ~Point3d origin = new Point3d(0.0, 0.0, 0.0);
& P, ^3 X* C5 T+ L6 b//************************************************************************** 8 C( s1 w( A, [) ~' @
//CREATE BLOCK 创建方块
+ V+ ?5 z0 R: B2 x5 l8 t" kBlockFeatureBuilder *newBlock = NULL;" }5 H2 F9 n9 v0 z# U5 i. D1 j
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); % m" k' x$ @( f
newBlock->SetOriginAndLengths(origin, "50", "80", "100");
5 F) K( B0 W- U' S/ nFeature *blockFeature = newBlock->CommitFeature();
3 l9 r; c$ }- `& M' enewBlock->Destroy();
$ y& B4 H+ V* i" \ [//**************************************************************************
. }* Y n. \4 m+ r2 Z/ w//EDIT BLOCK 编辑方块
, T' j7 ~- @0 o4 lBlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); ' l- T, S& X) X, |% W
oldBlock->SetOriginAndLengths(origin, "100", "20", "50");
5 D6 j' j8 p+ joldBlock->CommitFeature(); & R$ o) R. @' _
oldBlock->Destroy();
6 c7 i c' p, H4 y& ` V) I9 e" X2 `& R3 V+ M
|
|