|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
, h4 p, J; {8 Q/ c3 I- R) b
5 h& F- o! \- T% ?$ [' f1 G9 J; o. R8 N. Z! g0 _. r
Create a New Feature 创建NXfeature的标准过程
+ o) J+ @/ H3 |) d4 P# d1.Create an instance of the builder object for the desired feature type providing a null object as input. 4 L" S- U/ O9 R2 d$ @, p+ @
创建一个builder实例,null作为输入/ R/ |% B! X# ]
2.Edit the properties of the builder object to set the feature parameters and options.
& H X, `* b- Q. z编辑创建的builder,设置一些参数或者选项
3 u0 m& S2 p; M6 t" _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. # J1 [/ ]; {8 @0 L7 x8 D2 f" h
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
( \ J* j0 B& w/ V# y4.Use the Destroy method of the builder object to delete the builder object. + b$ y, T5 N( J& S5 G- u6 Y
使用destory方法删除builder对象。; g, r% ]1 q s! c* w
编辑特征也是同样的操作过程!+ n& A( T' f& \2 u# i2 m+ o
8 T, p2 n7 W# l; X4 b8 l, m代码举例:8 S" ?. D( F' d% d- ~, _6 ^4 m! g+ x
Session *NXSession = Session::GetSession();
" L: n" r3 v' W! ?3 }Part *workPart (NXSession->Parts()->Work());
* n; j7 K. A% a* T# z3 RFeature *nullFeature (NULL);
, D8 r' I6 U& A1 O' hPoint3d origin = new Point3d(0.0, 0.0, 0.0);
# ~$ T; a/ S5 ]8 B1 ?, J//**************************************************************************
$ a; l4 A, ^" H( V; N//CREATE BLOCK 创建方块
* i$ T; A4 r8 h( @* BBlockFeatureBuilder *newBlock = NULL;2 U3 O1 @5 u/ i3 A# j
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature);
) l! \) h7 g: P9 jnewBlock->SetOriginAndLengths(origin, "50", "80", "100"); 1 t" f P/ M! A- K/ h% [# l
Feature *blockFeature = newBlock->CommitFeature();
# X. j- Z1 X. QnewBlock->Destroy(); 1 V U5 X# W2 Q7 n9 u
//************************************************************************** $ z" a$ u: u, ^. Y2 P5 y
//EDIT BLOCK 编辑方块) }) R8 U, A$ O2 F4 g7 `
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
6 d+ q! D" ^5 Q: j4 C) ZoldBlock->SetOriginAndLengths(origin, "100", "20", "50");
4 o9 J# ~* F# q4 H8 Q' holdBlock->CommitFeature();
# C" v- X8 D# _7 [' ]; x+ toldBlock->Destroy(); % _- K3 T! c- {. i7 k( u
' E+ A- \0 i1 P; A( Q5 V
|
|