|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
& H) h) e ~! }
, b9 E- G" p$ m
* S% @4 M) \2 b+ _Create a New Feature 创建NXfeature的标准过程
4 K* d. N( K2 }7 O% d* Y1.Create an instance of the builder object for the desired feature type providing a null object as input. 6 P/ I9 q4 S4 t! L
创建一个builder实例,null作为输入* x6 }9 y# F# ~, X$ |& w% C0 a
2.Edit the properties of the builder object to set the feature parameters and options.
& J: Q b" e: r3 |编辑创建的builder,设置一些参数或者选项- [0 ]1 I; C/ A
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.
0 X1 V+ _' k: y4 z使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象' o1 x0 R m# e; u N
4.Use the Destroy method of the builder object to delete the builder object. " m& S2 o) s7 G$ G
使用destory方法删除builder对象。* ]; P' O: {8 b# o1 y' t7 u: Y# b
编辑特征也是同样的操作过程!
- ?; S, y) [7 G) }' l1 B, g
8 O2 w# [) G8 x9 i代码举例:, `) r c2 @- p- d2 f) I5 @
Session *NXSession = Session::GetSession(); 6 }+ h1 v# u/ l& g6 U
Part *workPart (NXSession->Parts()->Work());
! i. U: ?+ p5 H' N& JFeature *nullFeature (NULL);
, c+ v7 u5 {: nPoint3d origin = new Point3d(0.0, 0.0, 0.0);
% V) y( N o V//************************************************************************** 1 c' n' Y8 F: g# c# d. U
//CREATE BLOCK 创建方块
% x1 z- ?8 `' VBlockFeatureBuilder *newBlock = NULL;1 d, W8 ^5 ^. l( [3 |
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature);
1 |7 L3 N3 g& C- x2 ?/ x3 z3 _newBlock->SetOriginAndLengths(origin, "50", "80", "100");
+ w( C& N& R# J' eFeature *blockFeature = newBlock->CommitFeature();
9 a8 n& R- f2 G( R# _7 vnewBlock->Destroy();
c7 p& u! X; S$ z7 V/ s L//************************************************************************** 7 }* l( Y: h) q- {% ^
//EDIT BLOCK 编辑方块- r; s$ H( Y: R; ?5 }/ T
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature);
0 t7 o0 u. ?" T7 O; VoldBlock->SetOriginAndLengths(origin, "100", "20", "50");
; K5 W5 G" ?, H3 @' o, UoldBlock->CommitFeature(); & v" f2 X2 [& D0 |
oldBlock->Destroy();
. E( x5 L, L( _) D9 z9 L0 i; N- W- H0 K8 {( I) a- D
|
|