抱歉,那是我自己班上的,试试这个
- static void ExtTools_doit(void)
- {
- ads_name ename = { 0L , 0L };
- ads_point pnt = {0.0, 0.0, 0.0};
- AcDbObjectId eId;
- if(acedEntSel(_T("\nSelect Spline: "),ename,pnt) == RTNORM){
- acdbGetObjectId(eId,ename);
- }
- AcDbEntityPointer pEnt(eId, AcDb::kForRead);
- if(pEnt.openStatus() != eOk){
- return;
- }
- AcDbSpline *pSpline = AcDbSpline::cast(pEnt);
- if(pSpline == NULL){
- return;
- }
- double endParam,length;
- pSpline->getEndParam(endParam);
- pSpline->getDistAtParam(endParam,length);
- acutPrintf(_T("\nSpline Length is %g"),length);
- }
|