|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
' Q( A& J1 U& R: ^5 z
% t! G% `$ y) y; G) R; d
& P# X; W5 D& ?- C' ]2 k, N/ GCreate a New Feature 创建NXfeature的标准过程
& F1 ^9 r* I1 ^1.Create an instance of the builder object for the desired feature type providing a null object as input. l! j) V6 T8 P# W* {
创建一个builder实例,null作为输入$ I! [; t% {4 |8 `8 k* L+ [; c2 C
2.Edit the properties of the builder object to set the feature parameters and options.
( ~2 @1 Y3 h7 o T' e1 C$ x3 K编辑创建的builder,设置一些参数或者选项
! R4 t2 x V3 z" c( U/ o/ L3.Use the Commit method of the builder object to create an instance of the feature. The Commit method will return the new feature object.
4 r/ r" T0 \, U# c+ y E使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象; ^$ q0 m6 V) l& X& U
4.Use the Destroy method of the builder object to delete the builder object. ! T0 w+ z: u4 u
使用destory方法删除builder对象。- G6 n( g( x) s
编辑特征也是同样的操作过程!: j: Z7 }' D* h
2 y+ W, @$ o [3 z* x9 {8 u代码举例:
; f% {: z/ B0 WSession *NXSession = Session::GetSession(); * l4 B% m( b: p& w
Part *workPart (NXSession->Parts()->Work()); # e! R9 x' N! u- J; r* ~" Y. V
Feature *nullFeature (NULL); % s3 B' e& _% d5 m! h9 s/ S. p+ c
Point3d origin = new Point3d(0.0, 0.0, 0.0); # z! t7 {8 C: m7 a4 n
//************************************************************************** , u' s o9 p4 Y, u8 @; \
//CREATE BLOCK 创建方块
9 ]) R( O) \# ]4 A$ Z7 z( ABlockFeatureBuilder *newBlock = NULL;; n+ d; d3 Q* R8 g% l G9 g* W4 N
newBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature);
; |6 v% [/ G7 h4 T! J' fnewBlock->SetOriginAndLengths(origin, "50", "80", "100"); + e2 X( a% T' K2 F
Feature *blockFeature = newBlock->CommitFeature(); + R2 P( N6 Y+ {" J
newBlock->Destroy();
4 b) T7 }# g- J: j! s* f3 t$ G) G$ a//**************************************************************************
?% {# q! q# T+ J4 T9 |//EDIT BLOCK 编辑方块3 D o9 p* E/ L
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); " R5 d9 q$ w' D2 ?$ B5 X
oldBlock->SetOriginAndLengths(origin, "100", "20", "50");
# A. d; P D Q9 H2 Z& X6 holdBlock->CommitFeature(); / G3 O( L, r' a
oldBlock->Destroy();
% L8 U* y3 p* X' y% A
2 C/ V4 Q& M/ g7 O' L3 p( U- r |
|