|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
, H2 a& [4 f1 {. L, p0 q
, H% q5 O; ~( b2 m8 o3 L7 g
8 A( [' H& s* g3 I5 F& r% NCreate a New Feature 创建NXfeature的标准过程
( I5 e) y( S1 s7 M7 u# A( T1.Create an instance of the builder object for the desired feature type providing a null object as input. ) t8 V3 _# L3 i
创建一个builder实例,null作为输入" U, v( U' @8 C* T: O
2.Edit the properties of the builder object to set the feature parameters and options. . K6 ?, H& E( |
编辑创建的builder,设置一些参数或者选项$ P. |: D# H& l4 Q
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.
: T5 M# C" ~ {5 y使用commit的方法来创建这个feature的实例,这样就可以返回一个feature对象
4 I1 u* ~9 [$ h9 L! i0 t4.Use the Destroy method of the builder object to delete the builder object.
) n) M1 ?8 Z# H% R3 o( e6 m使用destory方法删除builder对象。/ f1 v4 e" g9 S+ M \
编辑特征也是同样的操作过程!
( D4 i* s L9 S1 x4 i8 O+ a; B+ ~# r* S7 s7 i" ~
代码举例:# v) J( j+ F& G8 g! W
Session *NXSession = Session::GetSession();
' }8 E4 D9 R) H/ @Part *workPart (NXSession->Parts()->Work()); 8 S6 y) I( ?9 Q; K% x4 Y, d
Feature *nullFeature (NULL);
' ?1 i3 u1 g1 g$ [( j# |Point3d origin = new Point3d(0.0, 0.0, 0.0);
& q+ r9 ?/ {( a+ ^//**************************************************************************
$ z$ g5 n! S3 ]9 o2 g# R1 f//CREATE BLOCK 创建方块
8 G4 }! v0 W. Q. g& i" g5 jBlockFeatureBuilder *newBlock = NULL;
+ x' n& I) k* X) C8 F& T+ MnewBlock = workPart->Features()->CreateBlockFeatureBuilder(nullFeature); / h1 B. u% O$ y
newBlock->SetOriginAndLengths(origin, "50", "80", "100");
/ h4 C/ ]: z1 w4 p( s) `Feature *blockFeature = newBlock->CommitFeature(); & z6 s0 l: R* |/ }7 [" ]
newBlock->Destroy();
. E" N# `# p1 l8 O z! Z$ E//**************************************************************************
) Q/ r. _* i& Y//EDIT BLOCK 编辑方块( w& q4 y4 n Z* F: O: K3 V' B
BlockFeatureBuilder *oldBlock = workPart->Features()->CreateBlockFeatureBuilder(blockFeature); $ _ a% H1 R( \1 W! `9 _
oldBlock->SetOriginAndLengths(origin, "100", "20", "50"); 5 V; Z. ^1 N* B$ t
oldBlock->CommitFeature();
/ J$ Z9 r k' roldBlock->Destroy();
: E- g( ?5 e9 A' D3 D: u! L3 ?% E: C) j% d/ Q
|
|