NX二次开发 UFUN访问电子表格
//NX8.0+VS2010
#include <uf_assem.h>
#include <uf_part.h>
#include <uf_obj.h>
#include <uf_modl.h>
#include <uf_view.h>
#include <uf_draw.h>
#include <uf_drf.h>
#include <uf_curve.h>
#include <uf_csys.h>
#include <UF_XS.h>
extern DllExport void ufsta(char* param, int* returnCode, int rlen)
{
if (UF_initialize())
return;
int result;
tag_t part_tag = NULL_TAG;
tag_t object = NULL_TAG;
char err_message[200];
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[UF_OBJ_NAME_LEN + 1];
char spreadname[UF_OBJ_NAME_LEN + 5];
char spreadname1[UF_OBJ_NAME_LEN + 5];
UF_OBJ_ask_name(object, name);
strcpy(spreadname, name);
strcat(spreadname, ".xls");
strcpy(s