|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
# Q5 B2 c3 R7 F1 T9 w' ~3 d' L5 K$ c; `+ S
# `9 r+ a# F- O
Create a New Feature 创建NXfeature的标准过程
1 X: q3 a4 F2 Z6 q5 ~9 c8 _0 H1.Create an instance of the builder object for the desired feature type providing a null object as input.
$ {9 v+ S3 [" v( G3 b0 y3 f创建一个builder实例,null作为输入
! N, W3 n! W7 n: F2.Edit the properties of the builder object to set the feature parameters and options.
: \3 c6 {/ R/ ^编辑创建的builder,设置一些参数或者选项9 T8 Y2 v9 \8 f8 l7 ^& c; d, |3 ]
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.
$ W8 N# Z0 ?& M5 ?" d' v使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象: i6 ?/ o: ?+ m
4.Use the Destroy method of the builder object to delete the builder object.
- o1 c, b! T7 r使用destory方法删除builder对象。
: m+ i5 r' F% g5 N编辑特征也是同样的操作过程!4 ^) G7 I/ m: u+ \, {
/ h* T. C) e5 ~6 {+ n代码举例:
. e& m2 n8 j8 p5 c. O4 T: ~$ YSession *NXSession = Session::GetSession(); / _* R5 j. g$ S; Q" X
Part *workPart (NXSession->Parts()->Work());
5 C" s7 Y$ d+ J0 LFeature *nullFeature (NULL);
6 }1 }# M4 M2 N1 W# |# X! x$ lPoint3d origin = new Point3d(0.0, 0.0, 0.0);
+ R* p4 s2 _# R* }3 ]) U//************************************************************************** # l3 a7 u& B B& M& S/ v
//CREATE BLOCK 创建方块
5 } R6 c2 t3 p$ V& }% HBlockFeatureBuilder *newBlock = NULL;
3 I- x0 L# H, t& v, pnewBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); . ~- d6 J9 t# U6 g: c3 c
newBlock->SetOriginAndLengths(origin, "50", "80", "100");
% U, A, y; K3 Q. ~, J4 G1 N! {Feature *blockFeature = newBlock->CommitFeature(); ) E9 M7 P. F6 v
newBlock->Destroy();
1 h) C3 [) P! U% X7 z1 i//**************************************************************************
7 W% d- M( E& v, S( P& T7 h//EDIT BLOCK 编辑方块$ l5 V! A& h; i9 e5 T
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); ; P( z2 q" M+ q$ o |: C9 \
oldBlock->SetOriginAndLengths(origin, "100", "20", "50");
; L$ z( ^* a& v2 M" ~6 XoldBlock->CommitFeature();
: g" y0 C% {- RoldBlock->Destroy();
+ r9 ]- B& S2 p& N; t7 h+ t4 A- ]& ?2 y
|
|