|
bool GetCurveLength(AcDbObjectId entId, double &length)
{
AcDbEntityPointer pEnt(entId,AcDb::kForRead);
if (pEnt.openStatus()!=Acad::eOk)
{
acedAlert(_RXST("无法打开实体对象!"));
return false;
}
if (pEnt->isKindOf(AcDbCurve::desc()))
{
double endParam = 0.0;
AcDbCurve *pCurve = AcDbCurve::cast(pEnt);
pCurve->getEndParam(endParam);
pCurve->getDistAtParam(endParam,length);
}
else
{
acedAlert(_RXST("该实体不是曲线!"));
return false;
}
return true;
} |
|