UG NX二次开发源码:ufun 访问电子表格的实例
访问电子表格的实例:
static void do_ugopen_api(void)
{
int result;
tag_t part_tag = NULL_TAG;
tag_t object = NULL_TAG;
char err_message;
part_tag = UF_ASSEM_ask_work_part();
result = UF_OBJ_cycle_objs_in_part(part_tag, UF_spreadsheet_type, &object);
while( object != NULL_TAG )
{
char name;
char spreadname;
char spreadname1;
UF_OBJ_ask_name(object, name);
strcpy(spreadname,name);
strcat(spreadname,".xls");
strcpy(spreadname1,"d:\\");
strcat(spreadname1,spreadname);
if( strcmp(name,"MODELING_SHEET") == 0 || strcmp(name,"DEFAULT_SHEET") == 0 )
uc1601(spreadname1, 1);
else
uc1601("当前Part没有电子表格", 1);
result = UF_XS_extract_spreadsheet(name,spreadname1);
if (result)
uc1601("抽取电子表格失败" ,1);
uc1601("请修改Excel表", 1);
result = UF_XS_store_spreadsheet(name,spreadname1);
if (result)
uc1601("存贮电子表格失败" ,1);
result = UF_OBJ_cycle_objs_in_part(part_tag, UF_spreadsheet_type, &object);
}
}
这是好东东,:)谢谢 怎么样插入数据,能不能用程序写入数据,请问怎么操作? xml_ug 发表于 2014-12-4 14:38
怎么样插入数据,能不能用程序写入数据,请问怎么操作?
插入数据 要用 MFC 相关的东东
ufun没有这个接口 刚看到还高兴哪,结果还得用MFC的功能插入,白高兴了:'(
页:
[1]