我把源码贴给你看看啊,这个不会报错但是倒不出来啊
int errorCode = UF_initialize();
if ( 0 == errorCode )
{
char part_fspec[MAX_FSPEC_SIZE+1];
int curr_part, num_parts;
int type;
int count_1;
tag_t part;
tag_t feature;
uf_list_t *tag_list;//创建链表放所有的solid的tag
UF_MODL_create_list(&tag_list);
/* Get the total number of loaded parts. */
num_parts = UF_PART_ask_num_parts();
for ( curr_part=0 ; curr_part < num_parts ; curr_part++ )
{
/* Get the part tag for the current part number of the
loaded part and get its part name.
*/
part = UF_PART_ask_nth_part( curr_part );
UF_PART_ask_part_name( part, part_fspec );
printf( title0, part_fspec );
count_1 = 0;
type = UF_solid_type;
feature = NULL_TAG;
/* Start the cycling process by passing in a NULL_TAG. */
UF_OBJ_cycle_objs_in_part( part, type, &feature );
UF_MODL_put_list_item(tag_list,feature);//添加tag值
/* Keep cycling until there are no more features to cycle. */
while ( feature != NULL_TAG )
{
int status = UF_OBJ_cycle_objs_in_part( part, type, &feature );
status = UF_MODL_put_list_item(tag_list,feature);//添加tag值
}
char filepath[20];
filepath[0] = '\0';
strcpy(filepath, "d:\\dddd.x_t");
UF_PS_export_data(tag_list,filepath);//导出parasolid文件
uc1601("dddddddddd",1);
}
errorCode = UF_terminate();
}
原帖由 cam-yp 于 2008-4-2 12:56 发表
函数是没有错的,我用的就是这个
file_name = "d:pp.x_t", 应该是file_name = "d:\\pp.x_t",
还有你要create LIST ,不要直接把SOLID 当作 LIST导出 |