You can use the getStartParam() and getEndParam() to obtain the start and end parameters of the Curve based entity and then use GetDistanceAtParameter() method to get the length of the Spline. Please find the code below which will calculate the Length of the Spline.
Acad::ErrorStatus es;
ads_name ename;
ads_point pt;
if (RTNORM != acedEntSel(NULL, ename, pt))
{
return;
}
AcDbObjectId objid;
acdbGetObjectId(objid, ename);
AcDbCurve* pEnt;
acdbOpenObject(pEnt, objid, AcDb::kForRead);
double startParam, endParam, startDist, endDist;
es = pEnt->getStartParam(startParam);
es = pEnt->getEndParam(endParam);
es = pEnt->getDistAtParam(startParam, startDist);
es = pEnt->getDistAtParam(endParam, endDist);
acutPrintf(L"nLength = %f", endDist - startDist);
Also in .Net, you can use the something like this to get the entity length.
a = curve.StartParam
b = curve.EndParam
length = curve.GetDistanceAtParameter(b) -
curve.GetDistanceAtParameter(a)

Leave a Reply to petconCancel reply