mildcat 发表于 2013-12-2 13:25:07

NX二次开发源码分享: 从文件读取数据,并在NX中生成点坐标


NX二次开发源码分享: 从文件读取数据,并在NX中生成点坐标
static void do_ugopenapi()
{
FILE *fp;
const int count = 3;
tag_t pnt_tag;
tag_t spline;
char msg;
double point;
char filename;
UF_UI_open_listing_window();
for(int i = 0 ; i < count; i++)
{
sprintf(filename,"C:\\temp\\pointdata%d.txt",i);
fp=fopen(filename,"r");
int j = 0;
if(fp)
{
   while(!feof(fp))
   {
      fscanf(fp,"%lf %lf %lf",&point,&point,&point);
      sprintf(msg,"Get the pointdata%d points are : \n %lf %lf %lf\n",i,point,point,point);
      UF_UI_write_listing_window(msg);
      UF_CURVE_create_point(point,&pnt_tag);
   }
}
else
{
   uc1601("Can not open the file!",1);
   
}
    fclose(fp);
}

}

<p> </p>
页: [1]
查看完整版本: NX二次开发源码分享: 从文件读取数据,并在NX中生成点坐标