|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
NX二次开发中有关删除特征,链表创建功能代码分享 [code]<p>! N0 D# W7 g+ Q. l7 X: M0 e1 D, u
static void do_UGopen_api(void)
6 z' s% \! j/ E! [5 I+ F9 U{
/ {* W6 b+ M% K. S // create block 1* d. ?' e! g0 l/ I* v# \
double coner[3] = {0,0,0};
1 t; Z5 I8 u* t% } char *edges[3] = {"l=100","w=100","h=20"};! \1 y3 i( c2 {6 B+ G
tag_t blk_tag;& D0 f3 F" _- ~$ e' D
UF_MODL_create_block1(UF_NULLSIGN,coner,edges,&blk_tag);
3 |, w ?! o% ?# ]. V; P // create a hole
; e s" C0 O: q w1 W double dir[3] = {0,0,1};
+ I& o& J: B0 m/ P: d4 C double coner1[3] = {50,50,0};% N$ `3 S) x# ~ c
tag_t cyl_tag;
' r" d# q8 q6 a% d" V/ p UF_MODL_create_cyl1(UF_POSITIVE,coner1,"h+30","50",dir,&cyl_tag);% `2 ^2 V" v% Q4 e. n
9 t& ?. }& A5 ?( q8 g /*
. t9 N7 `& [* h delete Feature
P5 M1 y0 E+ Q7 \. L */
+ o' ^ y7 B1 C" Z& ^ uf_list_t *featureList;
1 ?& Y$ b/ l: }+ H int count;
+ K0 O2 N7 d4 F! O UF_MODL_create_list(&featureList);
/ f" l, {1 X9 c UF_MODL_put_list_item(featureList,cyl_tag);
9 w& |0 U! E) C o) S9 Q UF_MODL_ask_list_count(featureList,&count);! o o; y( `4 M6 q4 P
for(int i = 0 ; i<count;i++)% S! j/ W8 s; G' w- L2 F9 v
{ ( T4 g, {" I: m6 a t
tag_t object;
# O3 o" s+ @9 ]7 m }1 u2 ]: W6 W0 l UF_MODL_ask_list_item(featureList,i,&object);7 g$ D( l% D) q( }; L
UF_DISP_set_highlight(object,1);
6 X* y6 h1 V# L9 i' ` M uc1601("Hightlight the Cylinder",1);
5 V4 q# g. T3 p0 I; ?. [8 i }
6 X! v9 V) [7 [ T6 g uc1601("Delete the Cylinder",1);
/ o+ ]# a. ~& p UF_MODL_delete_feature(featureList);
9 C, V( Y& p9 X" u UF_MODL_update();</p><p> // delete the list) z" O7 `& v3 K5 D1 v4 H7 @8 o9 i& h
UF_MODL_delete_list(&featureList);</p><p> // Delete the Block Directly
3 k0 k, t' v2 c5 M uc1601("Delete the block objects",1);" _" h# @3 a- u+ g2 V9 W, `
UF_OBJ_delete_object(blk_tag);</p><p>}</p>[/code]
& E& j" d' F" K+ d |
|