您的位置:网站首页 > Proe教程

ProE TOOLKIT应用中c/s的所有最新piv的得到方法

时间:2011-02-24 09:39:31 来源:

  本文介绍了ProE TOOLKIT应用中c/s的所有最新piv的得到方法。

  源代码如下:

  HPDMOQL oql;

  HPDMOQLET oqlet;

  PDMOQLCreate (&oql);

  PDMOQLAddStringOQLet(oql, "PDMc_PI", "", "", "", &oqlet);

  status = PDMPIGetList(oql, &piv_cursor);

  for(PDMCursorGetNext(piv_cursor, &pi); !(PDM_HANDLE_IS_NULL(pi)); PDMCursorGetNext(piv_cursor, &pi))

  {

  status =PDMPIGetName(pi, &pi_name);

  fprintf(g_pfileLog," the pi_name is %s",pi_name);

  //get the latest piv

  piv= GetLatestPIV(pi);

  PDMPIVGetName(piv, &piv_name);

  fprintf(g_pfileLog," the piv_name is %s",piv_name);

  .........

  }

  static HPDMPIV GetLatestPIV(HPDMPI pi)

  {

  HPDMPIV latest_piv;

  HPDMBRANCH branch;

  PTCERROR status;

  PDM_HANDLE_SET_NULL(latest_piv);

  PDM_HANDLE_SET_NULL(branch);

  status = PDMPIGetMainBranch(pi, &branch);

  if (PDM_HANDLE_IS_NULL(branch))

  return latest_piv;

  status = PDMBranchGetLatestPIV(branch, &latest_piv);

  return latest_piv;

  }