几何尺寸与公差论坛

 找回密码
 注册
查看: 2159|回复: 0

VC&OLE:GetBodyChordTolerance(double & chordTolerance)

[复制链接]
发表于 2007-3-27 11:01:39 | 显示全部楼层 |阅读模式
bool GetBodyChordTolerance(double & chordTolerance)
{
  bool      result = false;
  if (!m_dFace)
    return result;

  IFACE swFace(m_dFace);
  LPDISPATCH dBody = swFace.GetBody();  
  swFace.DetachDispatch();

  if (!dBody)
    return result;
  if (m_pSolidWorksGeom->m_dPreBody == dBody)
  {
    chordTolerance = m_pSolidWorksGeom->m_swChordTolerance;
    result = true;
    return result;
  }
  // get new chord tolerance if new body
  m_pSolidWorksGeom->m_dPreBody = dBody;
  IBODY swBody (dBody);
  VARIANT faceList;
  VariantInit (&faceList);
  LPDISPATCH dTessellation = swBody.GetTessellation(faceList);
  swBody.DetachDispatch();
  if (dTessellation)
  {

    ITESSELLATION swTessellation (dTessellation);
    chordTolerance = swTessellation.GetCurveChordTolerance();
    swTessellation.DetachDispatch();
    m_pSolidWorksGeom->m_swChordTolerance = chordTolerance;

    result = true ;
  }

  return result;
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-22 18:45 , Processed in 0.037170 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表