|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
' \9 T( B0 d) ~6 M9 \8 @. ~' l5 u: N4 d
2 X7 Q# b' X4 j' v0 Q5 FCreate a New Feature 创建NXfeature的标准过程
* ?, \ Q. R8 e2 k1.Create an instance of the builder object for the desired feature type providing a null object as input. 3 h9 K3 b% R6 V: l2 @
创建一个builder实例,null作为输入
& Z- w/ ~5 T* H2 d* i2.Edit the properties of the builder object to set the feature parameters and options.
y$ ^! R& f* ?1 e, p编辑创建的builder,设置一些参数或者选项
$ D# w+ M+ m' t. q# g$ [- Y3.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 t& Z. Y4 O% b" w( p5 E; y; t+ B
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
5 I$ f+ y7 q: d( i3 }/ F2 \' f4.Use the Destroy method of the builder object to delete the builder object.
1 J. |9 |. P4 @1 G( w8 z使用destory方法删除builder对象。
; q; `8 U9 r8 T" ^, X, c; C编辑特征也是同样的操作过程!
* T0 Q; d: y/ \, K. K9 C+ L
; K- F4 q+ U, w8 k( W5 S代码举例: Y1 k' [' Y4 j8 `8 h, L; U4 e2 W2 o
Session *NXSession = Session::GetSession();
/ J8 ?3 Z/ j* `8 GPart *workPart (NXSession->Parts()->Work()); 8 T" R2 w, `- L( x. a) _& z+ y
Feature *nullFeature (NULL); ( T- f3 Q/ c9 T; B
Point3d origin = new Point3d(0.0, 0.0, 0.0);
2 P% j# l6 S- f. W" r6 W; ~6 w0 F//**************************************************************************
/ O8 l- q" D( |//CREATE BLOCK 创建方块- |. w3 [2 U4 I* K0 W# V
BlockFeatureBuilder *newBlock = NULL;! C7 S! s v" j
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); : q7 X) k9 w2 O+ h4 [
newBlock->SetOriginAndLengths(origin, "50", "80", "100"); 5 m; M1 O/ g9 ^, D! L, r) H
Feature *blockFeature = newBlock->CommitFeature();
/ b- s: o2 }3 d: ynewBlock->Destroy();
8 p+ q8 A! P" C2 i//**************************************************************************
0 A/ e) L, f( n* |- v//EDIT BLOCK 编辑方块) U! z. K1 G) {, _8 O) |* K8 V
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); , z) w9 }4 n8 K$ c# p
oldBlock->SetOriginAndLengths(origin, "100", "20", "50"); ) ^( p1 q9 `1 w
oldBlock->CommitFeature();
' }9 Z) d5 x) n# A9 r# f5 \: DoldBlock->Destroy();
' l. O7 ^0 f4 g w* A6 d* L- `3 Y
( f$ M: v0 k$ v1 N |
|