|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
NX二次开发中有关删除特征,链表创建功能代码分享 [code]<p>" L- R5 t1 i& u7 A. m
static void do_UGopen_api(void)
. c2 T# @/ P2 \{8 F) }* h) F0 y- N+ p C6 B
// create block 1+ w x$ I) s/ y
double coner[3] = {0,0,0}; M8 z! I( t8 A$ G5 O( t( u4 Q
char *edges[3] = {"l=100","w=100","h=20"};
: |+ a3 C) X6 }, Z/ i# y tag_t blk_tag;, |; g$ R/ Q( n+ b& K7 X
UF_MODL_create_block1(UF_NULLSIGN,coner,edges,&blk_tag);
7 ]! E- N/ x9 b5 { // create a hole( Y4 B8 D; c5 V: x- L6 G
double dir[3] = {0,0,1};
: Q7 f) E. {5 Y1 |! |) f double coner1[3] = {50,50,0};
) L' G# ?$ ^+ }5 k: C% Z9 h tag_t cyl_tag;" A( v, r* U0 h' g
UF_MODL_create_cyl1(UF_POSITIVE,coner1,"h+30","50",dir,&cyl_tag);3 S) i% D `( r& A9 v7 Y( u
% M2 k1 u( L6 z0 r2 s /*
2 G. w5 z7 x% O! L$ T0 K" a3 N8 ?: f delete Feature4 h5 m6 E: ]$ J( K3 l
*/
/ s9 y1 t0 Z8 L, @ uf_list_t *featureList;8 t) y. k8 ^9 f5 A F; D( L' H
int count;
: `/ s' e. ` H8 d( J( | G UF_MODL_create_list(&featureList);! ] O0 A2 _$ H) m5 a! V" s; G
UF_MODL_put_list_item(featureList,cyl_tag);
! h- U2 G* f- u, A3 m UF_MODL_ask_list_count(featureList,&count);3 @4 F) d: r( T/ K I- d# a. C4 E: p, v
for(int i = 0 ; i<count;i++)0 k1 v( L" w3 f
{ . b* H1 l. A: W) e j8 C# T
tag_t object;
L, g0 a* W- w/ v' a UF_MODL_ask_list_item(featureList,i,&object);
/ ^3 k: y# `) P6 F" p# a UF_DISP_set_highlight(object,1); - Y7 S/ L% t t+ w B' v
uc1601("Hightlight the Cylinder",1);: v" k: J3 z: l) ~! P$ G3 l
}1 J$ h* \, o0 n: F t3 h; E
uc1601("Delete the Cylinder",1);
" q L+ |' ~5 P1 \9 f$ H- W" R UF_MODL_delete_feature(featureList);6 D4 p4 i) j0 I- c a
UF_MODL_update();</p><p> // delete the list
@6 U+ G" }5 t6 _' S3 f+ [/ I UF_MODL_delete_list(&featureList);</p><p> // Delete the Block Directly j% k- o$ Z: [* Q
uc1601("Delete the block objects",1);
0 y# G& L/ C2 s/ n6 ^0 V% @ UF_OBJ_delete_object(blk_tag);</p><p>}</p>[/code]8 A) h7 v8 M9 B0 W" k# R
|
|