|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
6 i/ X0 n6 l% D+ R
- N0 X/ ]+ B4 O# ^( J
0 @ T) t; F F0 Y- I# jCreate a New Feature 创建NXfeature的标准过程
4 j0 J3 _9 v, k% a3 S- K! q1.Create an instance of the builder object for the desired feature type providing a null object as input.
/ H( b, `) }( S. p创建一个builder实例,null作为输入
# T) V/ N, @- N$ o5 B( f% {2.Edit the properties of the builder object to set the feature parameters and options.
! T4 O4 v! h$ E: Q# Z编辑创建的builder,设置一些参数或者选项
# w6 U- i9 E6 R3.Use the Commit method of the builder object to create an instance of the feature. The Commit method will return the new feature object. & F8 V7 p! ]1 W. O/ Z3 k0 m
使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
; c& ?' M8 [9 W9 A4.Use the Destroy method of the builder object to delete the builder object.
* Y R& \& j5 U" y/ }使用destory方法删除builder对象。# I3 l+ E1 s7 z8 @! Z/ M4 w @
编辑特征也是同样的操作过程!
. |# Q8 q% V) J. j: U- y( O9 Z
5 U# e0 l8 t. d$ j: ~! M4 o代码举例:
y, ~: Y" z7 p0 d$ aSession *NXSession = Session::GetSession();
3 C/ i8 x1 N+ k: R. ]Part *workPart (NXSession->Parts()->Work());
+ v5 t8 z9 p+ k- [Feature *nullFeature (NULL); & M8 C$ P( {4 @! g$ m& U
Point3d origin = new Point3d(0.0, 0.0, 0.0);
% |/ z' M# Z* b$ N4 n7 ~/ @//**************************************************************************
7 _* F4 ?. n: @ M6 g//CREATE BLOCK 创建方块
& u( l( z# E% D: f9 o7 gBlockFeatureBuilder *newBlock = NULL;5 T8 V- T& F( a, y$ _" \
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); 1 R3 r; o7 d0 ~) m) W
newBlock->SetOriginAndLengths(origin, "50", "80", "100"); + [% I" [5 u" t
Feature *blockFeature = newBlock->CommitFeature();
, ?2 I, b) V3 L: h3 J% CnewBlock->Destroy();
# ~# e9 `: K& B) z* Z% R//**************************************************************************
+ l: W" a$ b. p2 ~2 ^) f' m1 f//EDIT BLOCK 编辑方块
8 ^7 b2 C: S5 j' B, p0 WBlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); & S1 ?- `! r! G# j# B# Q
oldBlock->SetOriginAndLengths(origin, "100", "20", "50"); 3 E" N/ d* A5 q5 l
oldBlock->CommitFeature();
8 R# p7 U; g' }oldBlock->Destroy();
* U1 x+ I# H! r i: D4 C. K; P+ A D! d; y5 D5 [: `6 Y+ X
|
|