iCAx开思工具箱

标题: 求助:Catsetting文件的读取 [打印本页]

作者: zzzrrr    时间: 2007-4-23 12:44
标题: 求助:Catsetting文件的读取
encyclopedia里面在middle ware部分介绍了catseting文件的读写方法,我试图用该方法读取catia自己生成的catseting文件的属性,但没有成功。下面是在use case的基础上改的一段程序,运行没有问题,但不能列出catsetting文件中的各种属性。请兄弟们指点一二。
main()
{

  cout << "The CAASysLineSetting program begins ...."<< endl << endl;

  // ---------------------------------
  // 0 - Get the repository class
  // ---------------------------------
  CATSettingRepository* SettingRepository = CATSettingRepository::GetRepository("CATProduct");
  if (SettingRepository == NULL)
  {
          cout<<"Fail to get the SettingRepository point."<<endl;
      return 0;
  }

  // ----------------------------------------------------
  // 1 - List all the attributes in the repository class
  // ----------------------------------------------------
  char*  oAttributeName = new char[100];
  char*  oAttributeClass = new char[100];
  long*  oAttributeSize = 0;
  short  iReset = 1;

  
  while (SettingRepository->NextAttribute(
                    oAttributeName,
                                        oAttributeClass,
                                        oAttributeSize,
                    iReset) == 0)
          {
          cout << oAttributeName
                   << " is an instance of the class "
                   << oAttributeClass << endl;
          }


  // -------------------------------------------------------
  // 12- Delete the CAASysLineSetting class
  // -------------------------------------------------------
  delete SettingRepository;
  SettingRepository = NULL ;

  delete oAttributeName;
  oAttributeName = NULL;

  delete oAttributeClass;
  oAttributeClass = NULL;

  delete oAttributeSize;
  oAttributeSize = NULL;

  cout << "The CAASysLineSetting program is finished ...."<< endl << endl;
  return 0;
  
}
作者: zzzrrr    时间: 2007-4-25 13:51
自己顶一下!
作者: zzzrrr    时间: 2007-5-9 14:36
自己再顶一下!




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3