超级版主
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
|
VC&OLE:GetBodyChordTolerance(double & chordTolerance)
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;
}
|