|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- l; z& C6 j; A, X& z. o" s! Y( I8 ^8 ~6 H% q/ Q3 u
: m, `7 N, P& Z8 \4 P+ OCreate a New Feature 创建NXfeature的标准过程4 A$ k5 f% J: z9 Q( D! | _
1.Create an instance of the builder object for the desired feature type providing a null object as input.
+ m6 y8 f3 a8 l$ l: X8 k创建一个builder实例,null作为输入
5 i* }& }9 u0 E/ \2.Edit the properties of the builder object to set the feature parameters and options. ) |" F, d( n6 U$ @" A& s
编辑创建的builder,设置一些参数或者选项! J5 V& @( ^* M! L- y. T+ g" |
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. ) `& T& D F9 e$ a& T1 L5 h
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象: q# S1 A- F r
4.Use the Destroy method of the builder object to delete the builder object. : g4 u' M- F$ z8 g' p4 t; ~
使用destory方法删除builder对象。
; V/ A% t+ G7 m0 r& j编辑特征也是同样的操作过程!
4 U& e% ]+ y! V' i
0 h2 D: n9 H4 K$ V9 S代码举例: L% [* Y+ \. v- d. |$ c7 b3 O
Session *NXSession = Session::GetSession();
. y1 b- T/ C! y8 Q" g4 g, gPart *workPart (NXSession->Parts()->Work()); - c8 V* v ?( U5 H, B+ z& X
Feature *nullFeature (NULL);
; U9 y& N: v/ X, U( yPoint3d origin = new Point3d(0.0, 0.0, 0.0); $ Y2 W0 X9 Y8 {- Y
//************************************************************************** + E" |3 I: B- h8 | ^- e
//CREATE BLOCK 创建方块 d, O3 d0 i& X! O \. z' x1 _
BlockFeatureBuilder *newBlock = NULL;# i( R0 ]! U# i% ]8 Z$ @
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature);
7 i3 f& M2 v0 F3 {newBlock->SetOriginAndLengths(origin, "50", "80", "100");
: }/ G5 b' G% H6 JFeature *blockFeature = newBlock->CommitFeature();
0 E" ?* d s, Y& Z0 HnewBlock->Destroy();
; r) }3 ~4 ^& k ^4 S//**************************************************************************
2 p2 p6 }3 X3 h. T//EDIT BLOCK 编辑方块
$ V1 O( v! G2 P6 f' B, sBlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
5 v! t& ^) o: EoldBlock->SetOriginAndLengths(origin, "100", "20", "50");
- ^2 M; A. X: G C" R6 W* JoldBlock->CommitFeature();
/ [$ a, I" }! uoldBlock->Destroy(); 8 k$ ~! H, B7 ~$ o9 j* O
2 g, v% t, X3 m, t9 T |
|