|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
. x# O4 n, g* v/ k( w; E2 G5 ]3 \; r# k4 R
, h; }2 `8 z" _" E p9 g4 ]% }; Z# D
Create a New Feature 创建NXfeature的标准过程
q/ Q; _; E2 C4 ]1.Create an instance of the builder object for the desired feature type providing a null object as input.
9 F* S8 s* \" A* U: M, h创建一个builder实例,null作为输入* z5 O. j0 U1 O% O2 f, Y" s
2.Edit the properties of the builder object to set the feature parameters and options.
8 u X! c, I; [! Y+ ]: f7 `+ h1 X' }编辑创建的builder,设置一些参数或者选项. a, d) y: k/ G s# x1 C
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.
# u9 B* }2 w+ r# g' k# Y9 ]使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
5 R- y ^( }5 K' |" L w$ h6 {( h4.Use the Destroy method of the builder object to delete the builder object. 5 j6 ?; {; ]- ?) D( N( I2 I
使用destory方法删除builder对象。
; g9 C5 A! w, A% z. _, J/ g. Q编辑特征也是同样的操作过程!: n6 w0 G2 }) |. L6 ^- [
, T, ~, \$ \ ?& \6 v1 z) k
代码举例:7 R9 }( C: v& o6 i
Session *NXSession = Session::GetSession();
K- p, b$ T: _; T5 k v! mPart *workPart (NXSession->Parts()->Work()); & C. P# V/ r# g. V7 W! X
Feature *nullFeature (NULL);
1 o" M9 M- ~- F: `+ dPoint3d origin = new Point3d(0.0, 0.0, 0.0); & f( h/ b2 S+ u' t9 H
//**************************************************************************
8 Y9 D% E- j1 I+ l. D. y# e, y//CREATE BLOCK 创建方块
) S. s4 V5 C) Q' f0 V# lBlockFeatureBuilder *newBlock = NULL;! d- z7 J& g/ o/ Y- G
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); # ]! @* {9 ?% c$ J# q1 ?
newBlock->SetOriginAndLengths(origin, "50", "80", "100"); . S: E9 Q( E% R d. h
Feature *blockFeature = newBlock->CommitFeature(); $ W, C/ @3 t) P8 t& _- ^
newBlock->Destroy();
& H0 j* T0 L; w$ N% b) l2 M; x) F# g9 P//**************************************************************************
, \& D9 s3 I( l4 ^ G//EDIT BLOCK 编辑方块
6 E: P- c4 {5 NBlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
; Z' o# C1 Q. i/ p B3 T* ToldBlock->SetOriginAndLengths(origin, "100", "20", "50"); 8 F$ B0 F- d: u. o7 x
oldBlock->CommitFeature();
+ j' b ]: s6 Z2 b& D9 foldBlock->Destroy();
5 _ ?: N1 E4 A' ~/ _/ r- Q& K" z! @1 y: W7 c/ b( U6 R: S! C
|
|