|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
NX二次开发中有关删除特征,链表创建功能代码分享 [code]<p>7 h! ]8 ?2 B/ B1 d- Z( d% ~
static void do_UGopen_api(void)8 B" g/ |! ?) C e/ l: x
{
) J" f, F* M K" ?; h6 h // create block 1( e' d! `6 D4 T
double coner[3] = {0,0,0};
1 S b0 S) O+ k1 \: ] char *edges[3] = {"l=100","w=100","h=20"};
$ m1 \/ G) d, ]6 n y+ [2 v4 G. p& L tag_t blk_tag;
( e( B9 ?: F2 @' i4 o7 t! W# V, c5 n UF_MODL_create_block1(UF_NULLSIGN,coner,edges,&blk_tag);
' k& a9 g0 }4 S- T3 L% H) F: ? // create a hole/ }' s8 l" o8 ]7 d8 m
double dir[3] = {0,0,1};3 ~# k7 N0 I0 @, u# ^4 J
double coner1[3] = {50,50,0};
! X/ p* H; }. a3 r. a tag_t cyl_tag;8 {* T0 z* s3 z- c9 e& |7 w
UF_MODL_create_cyl1(UF_POSITIVE,coner1,"h+30","50",dir,&cyl_tag);* y) P3 P/ f. `0 n/ U! x5 r
' M: q6 m* q& y5 q4 g4 T/ H/ X /*5 m+ k- l9 l3 `0 w
delete Feature: z! w- S/ C6 J
*/
|5 v: ~- O6 u uf_list_t *featureList;+ m( s" g' r% D1 T& \* E( C/ P
int count;+ \: R9 s a" Z: C* t
UF_MODL_create_list(&featureList);
) G+ Y3 K& q9 g3 j' A/ E' x5 K UF_MODL_put_list_item(featureList,cyl_tag);; j5 b+ P' y, D$ d$ H
UF_MODL_ask_list_count(featureList,&count);9 w+ O6 v8 Q2 P; y6 D: c% Z
for(int i = 0 ; i<count;i++). w2 X, m+ ^, z1 ~/ W
{
; Q6 n5 v2 I2 ~) ?4 K' b tag_t object;
5 Q8 c0 {) w& Y# E UF_MODL_ask_list_item(featureList,i,&object);' ]2 O0 p" Q; c0 S/ ^+ P
UF_DISP_set_highlight(object,1);
$ L( w; I% I) [% [: _ uc1601("Hightlight the Cylinder",1);
7 } B4 C5 O. m* {! ^- k, | }
$ X3 V3 w) L, K( @6 X5 W+ Q' s uc1601("Delete the Cylinder",1);% m, o5 e% c8 s# Y9 A
UF_MODL_delete_feature(featureList);
0 W9 P* W- T- `- M' E2 v7 O- T UF_MODL_update();</p><p> // delete the list
) g9 A. A8 }" X* z UF_MODL_delete_list(&featureList);</p><p> // Delete the Block Directly
3 U2 g7 v2 K' L$ S uc1601("Delete the block objects",1); X7 _0 m# x9 h4 ~3 F t
UF_OBJ_delete_object(blk_tag);</p><p>}</p>[/code]
, X: P) {) q! Q+ c) F* i: ^5 ?6 R |
|