|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
* _4 `$ v% H2 m+ n7 f- o
/ x& r$ j# b5 K, a- e7 [; ?: p* [* X6 Z' G' X7 L' N& e
Create a New Feature 创建NXfeature的标准过程
9 z4 i! H& @6 k# T+ P8 U" P6 j1.Create an instance of the builder object for the desired feature type providing a null object as input. : y# r9 [6 G' }" c0 Y* ?0 I
创建一个builder实例,null作为输入; s0 _7 p$ T/ s0 y7 Q7 y
2.Edit the properties of the builder object to set the feature parameters and options.
1 z0 n6 ^6 y8 R编辑创建的builder,设置一些参数或者选项; p9 N2 j, p: A* x
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.
( D. N3 z0 L3 F4 b) c1 g使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
5 ?1 `1 |( ?. y; r* ^4.Use the Destroy method of the builder object to delete the builder object. 4 e3 Z8 m3 q) B: j- m. A0 ^) {9 `
使用destory方法删除builder对象。
- V7 l& a, ^4 G; S& S8 D# i, E编辑特征也是同样的操作过程!. h' P8 ~4 B0 ?6 r
# R, y: T9 [$ {0 Y7 ~" S0 Q代码举例:& ?: K5 F9 q0 b& ~
Session *NXSession = Session::GetSession();
% B. g) |# s* i& \: hPart *workPart (NXSession->Parts()->Work());
g! P1 O" ^7 y0 lFeature *nullFeature (NULL);
' }( K; e" T% y/ }, @6 wPoint3d origin = new Point3d(0.0, 0.0, 0.0);
- q9 @7 `/ } V) J' ~8 q8 L% M0 u//************************************************************************** ; @9 g1 s$ n& ^% ^7 l! |/ @2 ` Q8 a
//CREATE BLOCK 创建方块6 P+ L8 p8 [7 c/ s# z
BlockFeatureBuilder *newBlock = NULL;; ^; V& t8 K# W( o3 E
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); 0 X& S9 _- M6 G( J# z
newBlock->SetOriginAndLengths(origin, "50", "80", "100"); : ]( q0 i$ I4 ?+ Q4 W: a8 _4 q" `; d4 P
Feature *blockFeature = newBlock->CommitFeature(); 0 ^3 k0 q+ { a, x( ^ u L
newBlock->Destroy(); ; _* s( |, t1 K; B& Z
//**************************************************************************
7 l/ a8 K1 x. c9 h, u0 Q//EDIT BLOCK 编辑方块
; L: ^2 I5 A5 _7 q& j5 t/ wBlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
1 d q0 ?; g+ z' G( boldBlock->SetOriginAndLengths(origin, "100", "20", "50");
" [9 p5 n( U; F0 N4 `9 @oldBlock->CommitFeature();
' n. d( ^# Y8 Q# }2 |8 X$ DoldBlock->Destroy(); , L! i4 f3 J; g# y9 n2 ^' y
9 [* I6 W" n6 Y ~- L7 ~% I% P
|
|