的确 ,是没有调用 UF_MODL_create_list() 的结果,现在问题解决了,
但是我想拉伸草图里的圆的话,
我先在草图中画了一个圆,现在想用API拉伸这个草图,我用
UF_OBJ_cycle_objs_in_part( part, type, &feature )来遍历
一、 设定type =UF_sketch_type,遍历到草图的特征标识 sketch_tag ;
二、 然后用 UF_SKET_ask_sketch_features(sketch_tag,&loop_list);
获得草图里的特征标识的链表 ;
三、 再用UF_MODL_create_extruded (loop_list,taper_angle,limit,ref_pt,direction,UF_NULLSIGN,&features);
来拉伸;但是总是不能拉伸成功,不知道是哪步做的有问题啊
代码如下:
char *taper_angle="0.0";
char *limit[2],limitl[2][30];
double direction[3]={0.0,0.0,1.0};
double ref_pt[2];
strcpy(limitl[0],"-20");
strcpy(limitl[1],"20");
limit[0]=limitl[0];
limit[1]=limitl[1];
int count_1,type;
tag_t sketch_tag, part_tag;
uf_list_p_t loop_list;
feature = NULL_TAG;
type=UF_sketch_type;
nume=1;
count_1=0;
part_tag=UF_PART_ask_display_part();
/* Start the cycling process by passing in a NULL_TAG. */
UF_OBJ_cycle_objs_in_part( part_tag,type, &sketch_tag );
while(sketch!=NULL_TAG)
{
count_1++;
UF_MODL_create_list(&loop_list);
UF_SKET_ask_sketch_features(sketch_tag,&loop_list);
UF_OBJ_cycle_objs_in_part( part_tag,type, &feature );
UF_MODL_create_extruded(loop_list,taper_angle,limit,ref_pt,direction,UF_NULLSIGN,&features);
UF_MODL_delete_list(&features);
}
} |