admin 发表于 2013-11-27 10:08:15

NX二次开发中有关删除特征,链表创建功能代码分享

NX二次开发中有关删除特征,链表创建功能代码分享   <p>
static void do_ugopen_api(void)
{
// create block 1
double coner = {0,0,0};
char *edges = {"l=100","w=100","h=20"};
tag_t blk_tag;
UF_MODL_create_block1(UF_NULLSIGN,coner,edges,&blk_tag);
// create a hole
double dir = {0,0,1};
double coner1 = {50,50,0};
tag_t cyl_tag;
UF_MODL_create_cyl1(UF_POSITIVE,coner1,"h+30","50",dir,&cyl_tag);

/*
delete Feature
*/
uf_list_t *featureList;
int count;
UF_MODL_create_list(&featureList);
UF_MODL_put_list_item(featureList,cyl_tag);
UF_MODL_ask_list_count(featureList,&count);
for(int i = 0 ; i<count;i++)
{   
tag_t object;
UF_MODL_ask_list_item(featureList,i,&object);
UF_DISP_set_highlight(object,1);
uc1601("Hightlight the Cylinder",1);
}
   uc1601("Delete the Cylinder",1);
   UF_MODL_delete_feature(featureList);
   UF_MODL_update();</p><p>   // delete the list
   UF_MODL_delete_list(&featureList);</p><p>   // Delete the Block Directly
   uc1601("Delete the block objects",1);
   UF_OBJ_delete_object(blk_tag);</p><p>}</p>
页: [1]
查看完整版本: NX二次开发中有关删除特征,链表创建功能代码分享