|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
* o( v9 x8 O0 p
5 r! q6 a0 W7 Q' j: M8 f. [2 V1 ^: D- H1 g% |' o5 e
Create a New Feature 创建NXfeature的标准过程
6 G5 ?9 z% O4 m, `8 K1.Create an instance of the builder object for the desired feature type providing a null object as input. . A+ Q( R1 F1 o) Q" k
创建一个builder实例,null作为输入
% N6 p" D3 v% }2.Edit the properties of the builder object to set the feature parameters and options.
. G/ _2 C% K% [- ^7 x编辑创建的builder,设置一些参数或者选项
6 V! H7 n! ^( y; f- A* a+ z N3.Use the Commit method of the builder object to create an instance of the feature. The Commit method will return the new feature object. : n/ i" Q7 V+ f, k# S* v. {
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象6 o% Z1 h$ y# C
4.Use the Destroy method of the builder object to delete the builder object.
. d" s" t4 K, H6 S使用destory方法删除builder对象。! Y4 J, z7 I" ?/ i4 K2 h
编辑特征也是同样的操作过程!
. I* b9 M+ @6 B9 e* u+ G, E: x6 F3 K
代码举例:; X! ^; ?' V1 ^* ~7 c
Session *NXSession = Session::GetSession();
8 j5 V$ D& r# B4 p. J/ KPart *workPart (NXSession->Parts()->Work());
: k- T% P% y, R5 S5 M* T& zFeature *nullFeature (NULL);
, o8 z o/ _$ j5 ]Point3d origin = new Point3d(0.0, 0.0, 0.0); 3 g# {6 L3 i- s ^: u- X
//************************************************************************** 5 ~9 d# g) Q+ s4 C) ^
//CREATE BLOCK 创建方块
6 s2 O7 P" e7 q) k" NBlockFeatureBuilder *newBlock = NULL;$ y/ V1 _, R2 M: M( G+ n
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature);
" h! A, _. a& p1 V: CnewBlock->SetOriginAndLengths(origin, "50", "80", "100");
6 w. {; t( q1 QFeature *blockFeature = newBlock->CommitFeature(); . h @ R# g4 a: {
newBlock->Destroy();
# z4 R0 C _( k5 B//**************************************************************************
0 x e# D+ X4 d. t//EDIT BLOCK 编辑方块
+ P* m# J+ o7 j2 }" FBlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); ( X E6 B% U0 \( ~4 X4 K- l
oldBlock->SetOriginAndLengths(origin, "100", "20", "50"); : r. c& p v8 O
oldBlock->CommitFeature(); . W; s8 y( K; v. x0 h/ L! J( ~) `
oldBlock->Destroy(); 6 X& t1 @7 _9 L! j- @
9 K! w O' Y/ W1 {8 I
|
|